Jump to:

3444 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » Output menu titles by field

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

Page: 1
Go to End
Author Topic: 844 Views
  • sca123
    Avatar
    Community Member
    61 Posts

    Output menu titles by field Link to this post

    Ok, I have a site that uses a 1 level menu structure in the CMS but is shown on the front-end in sections. Each page is associated to a section through a field called "Section" which has the id 1 to 5.

    So, what I need to do is output a sitemap broken down into sections. So I will hardcode the section name in the sitemap (Such as "News") then output all pages associated to "News".

    So I will have something like:

    NEWS
    <% if Pages.Section = 1 %>
    <% control [pages where Pages.Section = 1] %>
    <a href="$Link">$Title</a>
    <% end_control %>
    <% end_if %>

    I guess I will be need to create a control - but need help doing this.

    Any help would be appreciated.

  • sca123
    Avatar
    Community Member
    61 Posts

    Re: Output menu titles by field Link to this post

    Fixed this issue by modifying the sitemap code. Thanks

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