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   935 Views

Avatar
DeklinKelly

Community Member, 197 Posts

4 August 2010 at 7:27am

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

Community Member, 225 Posts

4 August 2010 at 8:40pm

$Parent.Parent.Foobar