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.

General Questions

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

Get the value of an item of the top-level parent


Reply

2 Posts   889 Views

Avatar
DeklinKelly

4 August 2010 at 7:27am Community Member, 197 Posts

In a template, how can I get the value of an item of the top-level parent?

For example,

Home
About
About/History
About/History/1999
Contact

In the above example, I have a third-level page named "1999". Its top-level parent is "About". I want the value of $foobar for the page "About".

Avatar
Devlin

4 August 2010 at 8:40pm Community Member, 215 Posts

$Parent.Parent.Foobar