Jump to:

23369 Posts in 18155 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Link between pages of different level

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 793 Views
  • Paco728
    Avatar
    Community Member
    28 Posts

    Link between pages of different level Link to this post

    Hello all.

    I'm trying to link from a one page (nueva zona) and from the childrens of this (nuevo equipo) to another page (nuestras sedes). Both are on the same level. I also want to link to the same site (nuestras sedes) from its parent page (nuevo torneo).

    The problem is i can't use template controls such as childrenOf(url) or page(url) because the user is going to be creating these pages dynamically.

    It's a bit complicated to explain, better leave the image so that it can be better understand

    Attached Files
  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: Link between pages of different level Link to this post

    If you don't need to place them in the template, then the content editor can just add the links in the content of each page. Otherwise you could use something like a has_one to SiteTree, and then a TreeDropdownField to select the page you want to link to.

  • Paco728
    Avatar
    Community Member
    28 Posts

    Re: Link between pages of different level Link to this post

    i doesn't need to place then in the template I just want to add the links in the content of each page, but i can't use the content of the editor they have to be created dynamically

  • Paco728
    Avatar
    Community Member
    28 Posts

    Re: Link between pages of different level Link to this post

    Solve my problem using in nuevo torneo template

    <% control Children %>
    <% if ClassName != NuevaZona %>
    <a href="$Link">$Title</a>
    <% end_if %>
    <% end_control %>

    in nueva zona

    <% control Parent %>
    <% control Children %>
    <% if ClassName != NuevaZona %>
    <a href="$Link">$Title</a>
    <% end_if %>
    <% end_control %>
    <% end_control %>

    and in nuevo equipo

    <% control Parent %>
    <% control Parent %>
    <% control Children %>
    <% if ClassName != NuevaZona %>
    <a href="$Link">$Title</a>
    <% end_if %>
    <% end_control %>
    <% end_control %>
    <% end_control %>

    I'm not sure if this is the best way but it worked

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