Jump to:

10989 Posts in 2726 Topics by 1817 members

All other Modules

SilverStripe Forums » All other Modules » Strange relative image Mobile Behaviour

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 368 Views
  • tazzydemon
    Community Member
    122 Posts

    Strange relative image Mobile Behaviour Link to this post

    Sorry about cross posting this but it was mighty unclear where I should as the principal question seems to be a data manipulation one.

    I have a weird one here. I have modified and extended the silverstripe-mobile module (using this fork https://github.com/fonsekaean/silverstripe-mobile) and am using a new version of jquerymobile.

    It all works fine save for one thing. The pages are ajax loaded and thus the base href is the calculated as the first page (say http://mydomain.com/home) This makes many subsequent images fail given that they start "assets" and not "/assets"

    That's when the wierdness starts. In the following example:

    <p><img class="left" src="assets/images/abouttheshow/_resampled/resizedimage350233-Fish1a.jpg" alt="show" width="350" height="233" />A show for the whole family.</p>
    <p class="clearboth">&nbsp;</p>
    <p><img class="right" src="/assets/images/abouttheshow/_resampled/resizedimage400266-Kids8a.jpg" alt="Kids" width="300" /></p>

    If I change the first image to "/assets" and save, it changes back and yet that does not happen to the image with the right class. Huh? This is clearly being manipulated by SS prior to saving but where? I can't find it.

    Furthermore how can I force the system or TinyMCE to use root relative urls. TinyMCE is surprisingly vague on this as their idea of relative and absolute urls is a bit different. I want root relative urls.


  • tazzydemon
    Community Member
    122 Posts

    Re: Strange relative image Mobile Behaviour Link to this post

    Eureka, sort of.

    I have partly found the answer to the strange rewrites of /assets/image.jpg to assets/image.jpg. In this real world example the leading slash gets stripped by the class that creates a new image size:



    I had missed that originally.

    So there remain 2 small issues...

    1. How do I insert images in the editor with the leading slash without having to do them manually - i.e which config or class do I have to modify.
    2. I am sure that the class responsible for the resizing should not be stripping the leading slash off. Its should leave the url in whatever state it was.


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.