Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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
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.
Use this code:
var home = Model.Content.Site().Children.OfType<HomePage>().FirstOrDefault();
Check out available Umbraco Helper methods here in docs - https://our.umbraco.com/documentation/reference/querying/umbracohelper/
Didn't work :(
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?
var home = Model.Content.Site().Children.FirstOrDefault();
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.
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.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted