Can content from a tab on the home page be propagated to other pages that use different template and doctype?
Hi,
I have a master template and a home template that inherits from it.
In the home document type I have a footer tab for footer links.
I only want this tab one the home document type.
Is it possible therefore to use the content from this home tab to populate the footer links on other page that use a different template? The footer is in the Master template by the way,
If I understand you correctly then I believe yes.
You would need to alter your master template so that when it renders the footer section it looks up the content tree to the home page.
Assuming your content tree looks like this:
Home
-> Second Page
-> Third Page
And assuming that you are using Razor (as I'm not certain if you can do it with the old approach) you should be able to call
@CurrentPage.Site()
This should give you the home page of the current site in your template and allow you to access the footer properties.
Yes this is possible, to use data from the homepage into another pages. You could use the Umbraco content helpers @Umbraco.Field and make it recursive. The Umbraco Field returns the value of that field from the Current Page.
Can content from a tab on the home page be propagated to other pages that use different template and doctype?
Hi,
I have a master template and a home template that inherits from it.
In the home document type I have a footer tab for footer links.
I only want this tab one the home document type.
Is it possible therefore to use the content from this home tab to populate the footer links on other page that use a different template? The footer is in the Master template by the way,
Thanks!
If I understand you correctly then I believe yes. You would need to alter your master template so that when it renders the footer section it looks up the content tree to the home page.
Assuming your content tree looks like this:
And assuming that you are using Razor (as I'm not certain if you can do it with the old approach) you should be able to call
This should give you the home page of the current site in your template and allow you to access the footer properties.
Hi Damon,
Yes this is possible, to use data from the homepage into another pages. You could use the Umbraco content helpers @Umbraco.Field and make it recursive. The Umbraco Field returns the value of that field from the Current Page.
https://our.umbraco.org/documentation/Reference/Querying/UmbracoHelper/
Like this:
Or if you are in a partial view or a partial view macro you can use the AncestorOrSelf(1) to get the homepage node
Or
Dependig if you are using dynamic Razor syntax or strongly typed Razor syntax.
Hope this helps,
/Dennis
is working on a reply...