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.

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   1307 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