I quite new to Umbraco and currently creating a few sites. To improve how it looks I have had to created top pages to allow for my pages to be sub pages
IE
Site One
Home Page
Content Pages
Site Two
Home Page
Content Page
Originally both Home pages were on the top level but found it complicated matters. I have on site One footer information i want to use across all of the pages. When the home page was on the top level i was using this code.
"var home = (HomePage)Model.Content.Site()"
Now I have moved it a level down I am unable to get anything to work. Is this possible?
Any advice appreciated but as I said I am new to this.
Hi Alex, this is where I have issues. Normally I see the error on the page error log. The admins of the version I am using does not want to turn them on.
What is the best way to create a Footer content ie Contact Details social media and opening hours.
Rather than doing this on every page I just want to do it once. How is this possible? I was using the example from the starter site but seems a bit limited.
I think the best way is to add these properties to the root node, it's super easy to extract root node properties from any page on the site.
Umbraco Helper has Root() method for retrieving the data from the root node. In Umbraco 7 exactly the same method called Site() it returns root IPublishedContent item.
Content from another page
Hello,
I quite new to Umbraco and currently creating a few sites. To improve how it looks I have had to created top pages to allow for my pages to be sub pages
IE
Site One
Site Two
Originally both Home pages were on the top level but found it complicated matters. I have on site One footer information i want to use across all of the pages. When the home page was on the top level i was using this code.
"var home = (HomePage)Model.Content.Site()"
Now I have moved it a level down I am unable to get anything to work. Is this possible?
Any advice appreciated but as I said I am new to this.
Thanks
Hi Michael,
Use this code:
Check out available Umbraco Helper methods here in docs - https://our.umbraco.com/documentation/reference/querying/umbracohelper/
Thanks,
Alex
Didn't work :(
What error? Can you share?
Hi Alex, this is where I have issues. Normally I see the error on the page error log. The admins of the version I am using does not want to turn them on.
Is there any other way to find logs?
maybe this:
I suppose the question I should be asking is.
What is the best way to create a Footer content ie Contact Details social media and opening hours.
Rather than doing this on every page I just want to do it once. How is this possible? I was using the example from the starter site but seems a bit limited.
Thanks
I think the best way is to add these properties to the root node, it's super easy to extract root node properties from any page on the site.
Umbraco Helper has Root() method for retrieving the data from the root node. In Umbraco 7 exactly the same method called Site() it returns root IPublishedContent item.
Thanks,
Alex
is working on a reply...