I've tried to make the logo editable aswell by following the same process but giving the property a mediapicker instead of rich text editor and then uploaded my own pic to the media section and pointed it to that.
This has not worked, where the pic should be in the head i have 1088 instead, and i don't understand why?!
Can anyone advise how i can get this logo in via the content section? Also, i've added the code to the master template but adjusted the doc type for the homepage, as you will know, this will only display what the end user enters in the homepage and not any of the others. I don't seem to have a doc type for the whole site, how can i make it so what is entered is shown on every page?
Hope this makes sense, thanks in advance for your help!
The Media Picker stores the ID of the selected Media Item. To translate that into an image, you need to use the umbraco library method called GetMedia. Usually this is done from an XSLT Macro, but you can also do it via inline XSLT on your umbraco:Item tag:
If you add recursive="true" to your umbraco:Item tag, it will walk up the content tree until it finds a page with that field and will use the value from there.
Editable Header/Footer
Hi all,
Back again lol
I am trying to make the header and footer editable by the end user via the content area.
I'm working from the business package where they are hardcoded in the master template. I've removed the hardcode and entered:
<h1><umbraco:Item Field="bodyHeader" runat="server" /></h1>
then added a tab in the Homepage doc type for the header and gave it a rich text editor property called bodyHeader.
In the business package there is 2 elements to the header, one being the text and the other is the logo:
<div id="header">
<a href="/"><img src="/images/logo.gif" width="259" height="65" /></a>
<div id="sitedescription">
<h1><umbraco:Item Field="bodyHeader" runat="server" /></h1>
</div>
I've tried to make the logo editable aswell by following the same process but giving the property a mediapicker instead of rich text editor and then uploaded my own pic to the media section and pointed it to that.
<div id="header">
<a href="/"><umbraco:Item Field="picHeader" runat="server" /></a>
<div id="sitedescription">
<h1><umbraco:Item Field="bodyHeader" runat="server" /></h1>
</div>
i've tried it like this aswell
<div id="header">
<umbraco:Item Field="picHeader" runat="server" />
<div id="sitedescription">
<h1><umbraco:Item Field="bodyHeader" runat="server" /></h1>
</div>
This has not worked, where the pic should be in the head i have 1088 instead, and i don't understand why?!
Can anyone advise how i can get this logo in via the content section? Also, i've added the code to the master template but adjusted the doc type for the homepage, as you will know, this will only display what the end user enters in the homepage and not any of the others. I don't seem to have a doc type for the whole site, how can i make it so what is entered is shown on every page?
Hope this makes sense, thanks in advance for your help!
Dom
Hi Dominic,
The Media Picker stores the ID of the selected Media Item. To translate that into an image, you need to use the umbraco library method called GetMedia. Usually this is done from an XSLT Macro, but you can also do it via inline XSLT on your umbraco:Item tag:
For info on doing this in XSLT check out Lee's blog post.
Hope this helps,
Tom
Thanks for your reply Tom.
I've added the extra bit of code but know it displays /media/148/cu.jpg'/> instead of the image :oS
Hmm..did you wrap the <img src=' tag around it like I have above?
ops, i did not.
its working now. thanks ever so much :oD
Now i just need to know how to apply it to all the pages at once rather then just the home page
Oh yeah, sorry forgot to mention that.
If you add recursive="true" to your umbraco:Item tag, it will walk up the content tree until it finds a page with that field and will use the value from there.
simple as that eh, been trying for hours hehe
thanks again mate, you've saved my headache lol
is working on a reply...