Page 1 of 1
[SOLVED] Display Header BG according to page alias?
Posted: Sun Oct 21, 2012 11:41 am
by CapereSpiritum
Hi
I've a fishing website that I've recently converted to CMSMS.
Best Fishing
It used to be a complicated static site but after conversion I've lost the ability to display a header image according to the section of the website.
In the old site I had a class in the body tag like this;
And a css class in the header TD like this
Code: Select all
<td class="Header" id="headerimage">
The CSS to call the image is this
Code: Select all
BODY.coarse-fishing #headerimage {
BACKGROUND: url(Fishing_Tackle/Images/Header-Tench.gif) no-repeat left top
}
I'm attampting to do similar but using {page_alias} and an apropriately named image.
Now using 'divs'. Header div is called 'header'
Anyone know what the correct CSS is?
Re: Display Header BG according to page alias?
Posted: Sun Oct 21, 2012 12:58 pm
by gianpiero
I'm very interested in this.
I solved with differents templates and stilesheets, changing only header, logo, but this is no possible when there are too many sections
Re: Display Header BG according to page alias?
Posted: Sun Oct 21, 2012 2:32 pm
by velden
Are you aware of the possibility to choose an image in the options tab while creating/editing a page?
If that's not what you're looking for take a look at the tag {content_image}. It gives the user/you the possibility to choose an image per page.
Re: Display Header BG according to page alias?
Posted: Sun Oct 21, 2012 5:43 pm
by Dr.CSS
</__body class='{$page_alias}'>
Re: Display Header BG according to page alias?
Posted: Tue Oct 23, 2012 9:54 pm
by applejack
Install and use CGISimpleSmarty module then you can easily use images based upon section.
Re: Display Header BG according to page alias?
Posted: Wed Oct 24, 2012 12:01 pm
by CapereSpiritum
gianpiero wrote:I'm very interested in this.
I solved with differents templates and stilesheets, changing only header, logo, but this is no possible when there are too many sections
That seemed the most practical way to go.
Thanks all
Take a look
Best Fishing
Re: [SOLVED] Display Header BG according to page alias?
Posted: Wed Oct 24, 2012 12:09 pm
by gianpiero
yes
it's an easy solution, works and easy to apply.
I've never searched for a better solutions but I'sure that exist, based upon the other suggestions of this topic
gianpiero
Re: [SOLVED] Display Header BG according to page alias?
Posted: Wed Oct 24, 2012 12:49 pm
by applejack
Using differents templates and stylesheets is not the way to go as it increases maintenance and admin time and is not necessary. You should make as few as possible. You can do lots of useful things by utilising the url i.e. {$page_alias} Take a look at CGISimpleSmarty it is well worth it. Also you should use global content blocks as much as possible in templates such as for the head and footer, search block, main menu etc