Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » links or images in subpages

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: 1238 Views
  • janulka
    Avatar
    Community Member
    80 Posts

    links or images in subpages Link to this post

    Hei,
    I got problem with my latest site, when i insert image for example in "contact" subpage, SS links it following way:

    src="assets/Uploads/IMAGE", thats quite fine i guess?

    but then browser is looking for following image including sublink: contact/assets/Uploads/IMAGE

    same as links - when i link from contact to f.e. home using href="/home", browser is looking for following: contact/home

    weird? help plz? thanks

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: links or images in subpages Link to this post

    Do you have $BaseHref in your template?

    This really shouldn't be happening if the html is being written with the first slash, regardless of having the base url or not.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: links or images in subpages Link to this post

    <% base_tag %> should be in the <head> of your Page.ss HTML. Alternatively, you can define the <base> tag yourself; <base href="$BaseHref">

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: links or images in subpages Link to this post

    yess!

    wrote html for Page.ss from scratch and somehow forgot about <% base_tag %> in the <head>, this worked it out, thanks a lot!!

    1238 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.