Posted By dax on 09/26/2008 1:59 PM
I sometimes use the Page Icon option in page settings to do this. It is in the Advanced Settings area. You can then put this code in your SKIN (not css file) to get it to work. Just put this in css for the body tag (or where ever you want it).
background: url(<%=PortalSettings.ActiveTab.IconFile%>) no-repeat;
I did this in my skin where I wanted a header graphic to be the same for all pages in a section of the site. In otherwords, all pages below the About Us main tab had the same header graphic. You could change it to be a background graphic if this is what you are going for.
< img class="imgPageHeader" src="http://www.snapsis.com/Portals/0/images/pageheaders/hdr<%= PortalSettings.ActiveTab.BreadCrumbs(0).TabId %>.jpg" alt="Header Image" / >
(remove the spaces in the start and end of the code) You then need to put an image named hdrTabID.jpg in the /Portals/o/images/pageheaders/ folder. This requires you to see what the page ID is of each top level navigation page. Easiest way to do that is to surf to the page, click page settings and look at the URL and see the tabid in the URL.
Hope this helps...
Dax
Dax,
Thanks for the tips. In the end I added a Javascript snippet to do this that worked along the same lines as what you have here.
<_script_type="text/javascript">
var myBG = "url(/Portals/6/blohm/imgs/hdr" + <%=PortalSettings.ActiveTab.BreadCrumbs(0).TabId%>+ ".jpg)";
document.body.style.backgroundImage = myBG;
<_/script>
I may change it to use the page icons method, and need to add logic to load a default if the calculated filename doesn't exist.