Im trying to let my users select there own logo in a top node, I then whant that same logo to be available to all sub pages.
This is my current structure:
1. TopPage (select logo)
1.1 About us
1.2 My Extra Page
So if i select a logo in the generics tab on top page, iv set it to a master template that all pages inherent from but when i go to the page "about us" or "my extra page" then the logo cant be found, since its trying to access the generics value that only can be found if im at "TopPage".
I at first tried to let the TopPage have a master document type and then let the other sub pages have a child document type so that it would have the same generics, but this would force my users to select the same logo for all pages. This is not an option.
this isn't the way I'd normally do this but I can see that it could work
maybe you were intending to add recursive="true" to the Umbraco:Item element?
this will mean that if the field is not filled or present on the current page it will search backwards through the page's ancestors until it finds a page with this value
so then the sub-pages will use the value set on the home page parent
I've not tried this approach but it looks like it should work and so your Umbraco:Item element would change to
Inherent Logo from top node
Hi,
Im trying to let my users select there own logo in a top node, I then whant that same logo to be available to all sub pages.
This is my current structure:
1. TopPage (select logo)
1.1 About us
1.2 My Extra Page
So if i select a logo in the generics tab on top page, iv set it to a master template that all pages inherent from but when i go to the page "about us" or "my extra page" then the logo cant be found, since its trying to access the generics value that only can be found if im at "TopPage".
Current code for master template
I at first tried to let the TopPage have a master document type and then let the other sub pages have a child document type so that it would have the same generics, but this would force my users to select the same logo for all pages. This is not an option.
Please do help!
Best Regards
Marthin
i am not sure how this is working -
concat('<img src="', umbraco.library:GetMedia({0},'true')/data[@alias='umbracoFile'], '" />')
where you have GetMedia({0},'true')
i assume the {0} comes from the field="logotyp"
this will only work for the current page
this isn't the way I'd normally do this but I can see that it could work
maybe you were intending to add recursive="true" to the Umbraco:Item element?
this will mean that if the field is not filled or present on the current page it will search backwards through the page's ancestors until it finds a page with this value
so then the sub-pages will use the value set on the home page parent
I've not tried this approach but it looks like it should work and so your Umbraco:Item element would change to
Hi, I did as you said and added
That solved everything
Thanks for the help!
excellent - my 2nd ever solution ! starting to enjoy this... glad to be able to help
is working on a reply...