Jump to:

3430 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » 2.4 branch : nested urls and translation

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

Page: 1
Go to End
Author Topic: 1597 Views
  • pac
    Avatar
    Community Member
    25 Posts

    2.4 branch : nested urls and translation Link to this post

    there seems to be a problem with nested urls and translation, $URLSegment does not return the entire path with the locale

    any new parameter I should know about ?

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: 2.4 branch : nested urls and translation Link to this post

    Would like to know this too, have the same problem, could not find anything in the docs.

    Do I need to search the parent(s) every time I want to get an url, or is there a way to create a link using id, or ... ?

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: 2.4 branch : nested urls and translation Link to this post

    The $Link variable in the templates seems to be working fine (running on 2.4 branch with Translatable), is $URLSegment really supposed to return anything else than just what's in the database field URLSegment?

    The Link function in SiteTree does this:
    return Controller::join_links(Director::baseURL(), $this->RelativeLink($action));
    and the controller function with the same name simply calls the Link function on the associated data record so if you only want the link without http://... $this->RelativeLink() should give you what you need I think.

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: 2.4 branch : nested urls and translation Link to this post

    Thank you so much! It worked!

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