Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » How to set the correct path of an image in content field ?

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 961 Views
  • Allisone
    Avatar
    Community Member
    27 Posts

    How to set the correct path of an image in content field ? Link to this post

    Hello.
    I have normal pages, which have content, in the content I sometimes have images.
    Lets say the page can be called like this localhost/about/

    Now I also have a virtual page, taking the content from that original page
    This virtual page I can reach like this localhost/summary/about/

    When I add a picture into my content I get this path generated: src="assets/Uploads/xyz.png"

    The problem is. Even when loading the picture from this page localhost/about/ the assets/Uploads/xyz.png won't exist. Which could make me think I just have too write ../ before assets. But because of my additional virtual page, I'd still have a problem

    I thouhgt maybe the mod_rewrite would take care of this problem but somehow it doesn't seem to do that :/

    Does someone has a strategy ?

  • Allisone
    Avatar
    Community Member
    27 Posts

    Re: How to set the correct path of an image in content field ? Link to this post

    Finally I typed in the right search words, so that I could find another post in this forum dealing with the same problem.

    You need to have <% base_tag %> in the head of your HTML template. See http://doc.silverstripe.com/doku.php?id=tutorial:1-building-a-basic-site#templates

    961 Views
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.