Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show property of masterpage on a page in Umbraco

I have an umbraco project with a masterpage (with it's own content type) and a homepage underneath it.

The masterpage content type includes stuff like the footer, header etc.

However when I look at the homepage, the properties of the masterpage don't display. In the masterpage template I have the line:

<umbraco:Item field="footerText" runat="server" />

But this doesn't pull the footerText property from the masterpage properties.

I am guessing it has something to do with the fact that properties are not inherited, so how do we go around that? Writing a simple macro that pulls the data or is there a quicker way?

Many thanks

like image 736
Nick Avatar asked Mar 31 '12 10:03

Nick


1 Answers

If you're trying to access fields belonging to a parent node, you would set the recursive attribute to true:

<umbraco:Item field="footerText" recursive="true" runat="server" />

When you are editing your masterpages via the template editor in the Umbraco backend, you can use the "Insert umbraco page field" dialog to help build your tags.

like image 115
Douglas Ludlow Avatar answered Sep 22 '22 13:09

Douglas Ludlow