Jump to:

520 Posts in 248 Topics by 263 members

Content Editor Discussions

SilverStripe Forums » Content Editor Discussions » sitetree_link shortcut return wrong link (SS 2.4)

Forum for content editors and CMS users.

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

Page: 1
Go to End
Author Topic: 1236 Views
  • vovanbo
    Community Member
    3 Posts

    sitetree_link shortcut return wrong link (SS 2.4) Link to this post

    My base url is "". Site tree looks like this:

    home (id=1)
    --- good (id=2)
    ------ article1 (id=4)
    ------ article2 (id=5)
    --- bad (id=3)
    ------ article1 (id=6)
    ------ article2 (id=7)

    When i use sitetree_link id=4 on page "good", SilverStripe return link with href="/silverstripe/home/good/article1". But it's wrong, because expected href is "/home/good/article1", or even "".

    On now moment i have next situation. I need to get complete url in javascript using jQuery. But in this code:

    var completeURL = jQuery('base').attr('href') + page;

    where 'page' is href of current link (ex. '/silverstripe/home/good/article1'), variable completeURL take value ''.

    Can anybody help me to solve a riddle?

    Thanks in advance.

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.