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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

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


Go to End


2 Posts   1233 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, 344 Posts

4 August 2010 at 8:40pm

$Parent.Parent.Foobar