Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Category-Name of Article


Go to End


2 Posts   1289 Views

Avatar
jbk

Community Member, 11 Posts

16 September 2008 at 8:46pm

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 =)

Avatar
ajshort

Community Member, 244 Posts

16 September 2008 at 9:23pm

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:

<ul>
	<% 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 %>
 </ul>

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