We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4011
    • 19 Posts
    Dear all,

    Either I have found a bug or there must be a way unknown to me to produce absolute paths when including images with an Image TV using the Image Widget. I have included the image via [*EventsPicture*] in the template and the result looks as follows:

    <img class="eventpicture" src="assets/images/Events 2008/event1.jpg" />


    Is there any way to either just return the path of the image or return the absolute position?
    assets/images/Events 2008/event1.jpg
    or

    <img class="eventpicture" src="/dev/assets/images/Events 2008/event1.jpg" />


    I’m using url rewriting, which is the reason why I need the absolute path.

    Thanks a lot for your highly appreciated help!

    Cheers,

    brans
      • 25663 MODX Staff
      • 12,272 Posts
      If you add the following to your template in the head section, you won’t have problems with relative paths:
      <base href="[(site_url)]"></base>
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 4011
        • 19 Posts
        It still doesn’t show me the image. Somehow the same procedure works for all the other TVs but even though the image is at the specified location, it just doesn’t load. Could there be any other problem except for the path problem?
          • 25663 MODX Staff
          • 12,272 Posts
          Have a link to a sample of what’s breaking down?
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 25969
            • 118 Posts
            <base href="[(site_url)]" />

            Does that help?
              • 4011
              • 19 Posts
              Unfortunately it doesn’t help. I do not want to link the page because it just a temporary development setup. But you can find it under:

              startglobal dot org (no www subdomain!) slash: dev/events/2008/january/venture_businessplan_wettbewerb2008.html
              (view the source code of this page)

              Please note that in the meantime I have renamed the folder (from Events 2008 to Events2008) and changed the reference but it still doesn’t change anything. As soon as I add the absolute path /dev/... manually the image is displayed. I’m using flock browser.
                • 25969
                • 118 Posts
                I noticed the <base /> was inside the <style> block, taking it out of there and near the top of the head will probably work.

                Also, this is what it looks like for me.