Jump to:

513 Posts in 209 Topics by 259 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: 1186 Views
  • vovanbo
    Avatar
    Community Member
    3 Posts

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

    My base url is "http://192.168.1.1/silverstripe/". 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 "http://192.168.1.1/silverstripe/home/good/article1".

    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 'http://192.168.1.1/silverstripe//silverstripe/home/good/article1/'.

    Can anybody help me to solve a riddle?

    Thanks in advance.

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