Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Category-Name of Article

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 925 Views
  • jbk
    Community Member
    11 Posts

    Category-Name of Article Link to this post

    Hey Guys,
    at my Category 'Sample' i´ve created many Sub-Articles. Now i want to show at the frontend in which Category this Article is posted. How does it work?

    Thx =)

  • ajshort
    Community Member
    244 Posts

    Re: Category-Name of Article Link to this post

    Hey JBK,

    Im assuming that youve created your articles/sub-articles just like normal pages/sub-pages. If so, then you can use something like this piece of code to display the parent page/category next to the navigation link:

       <% control Menu(1) %>   
          <li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML ($Parent.Title)</span></a></li>
       <% end_control %>

    Note the $Parent.Title bit - that allows you access to the current page's parent object.

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.