Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Different headers for different pages? Is it possible?

Different headers for different pages? Is it possible?

Locked

Views: 1,068

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
12 Nov 2010, 1:49 AM
#1
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Different headers for different pages? Is it possible?

I am in the testing stage and i am not sure what is feasible or not (or how). I am looking at an animated header that will display some product previews and their use but i would like it ONLY on the main page header while i feel it then becomes a distraction for other pages while the customer is already looking at a product, a review or going through checkout.

Is it something feasible?

12 Nov 2010, 7:34 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Different headers for different pages? Is it possible?

Sure. There are various ways you could do it, depending on exactly what and where you want it. One of the easiest would be to add your code to tpl_header.php, wrapped in a test like```php
if{$this_is_home_page){
//your animated code
}

If you don't know how to get animated content, I'm sure you can find some flash or javascript solutions by googling.
12 Nov 2010, 10:40 AM
#3
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Re: Different headers for different pages? Is it possible?

As i was reading on this topic, searching in this forum, i read somewhere that flash was not accepted (or useable) in headers. Probably misread or misunderstood.

Here is a sample of what i would like to have on the MAIN page: http:/creationcassel.com/storetest (the animation is only a gif here). Can i use a code that IF it is the main page, use the gif image but if not, use a jpg one?

12 Nov 2010, 3:27 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Different headers for different pages? Is it possible?

It is a common opinion that flash is not good to use because it is slow to load, but people use it in headers all the time. What you read may have been that it cannot be used in the <head> section of an HTML page's code (not sure).

The if() test I posted above would be what you wrap around your gif output.```php
if{$this_is_home_page){
//your animated gif code
}else{
//your static jpeg code
}

12 Nov 2010, 4:55 PM
#5
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Re: Different headers for different pages? Is it possible?

That is possibly what it was. Since i am not very knowledgeable in animation (except for gif files), i will look into it. Thank you for pointing me in the right direction.

12 Nov 2010, 10:34 PM
#6
tor86 avatar

tor86

New Zenner

Join Date:
Sep 2010
Location:
Leamington Spa, UK
Posts:
31
Plugin Contributions:
0

Re: Different headers for different pages? Is it possible?

Sorry to hijack, but on a similar theme...is it possible to display a different banner in the content area for different category pages? So for example, a category for shoes would have a shoes banner for that category and all its subcategories?

13 Nov 2010, 1:23 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Different headers for different pages? Is it possible?

That is something that Smart Backgrounds in Free Addons would be good for. If the banner is a background for an area, it will work directly; if you want to switch foreground images, there is a simple coding method described in the readme.

13 Nov 2010, 2:08 AM
#8
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Re: Different headers for different pages? Is it possible?

Someone saw my currently draft animated header and liked it. One thing she asked is whether it was possible to have those animated images clickable in case a customer would see one product displayed and wanted to go to that particular product. I think that would be great if it is feasible but i am not setting my hopes too high on that one. But still, i am curious to know whether it can be done, in any way.

13 Nov 2010, 2:17 AM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Different headers for different pages? Is it possible?

My guess would be that an animated gif cannot have multiple links for different frames, but I don't know for sure. Dynamic Drive's Ultimate Fade-in Slideshow (javascript) does have that ability, and others likely do as well.

13 Nov 2010, 3:19 AM
#10
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Re: Different headers for different pages? Is it possible?

Wow.... this is promising!!!

Now, since i am still going really step by step, i would need your help in figuring out a few (probably) simple things:

  • which file should i edit to wrap around the gif code? the css file? or another one?
  • what file formats can be used for the background-image in the logowrapper? That Dynamic Slideshow looks exactly like what i would dream of, but does it take that output file in there?
  • finally, is it possible to have two separate "images" in the header so i can animate and link only one part while keeping the other static and unlinked?

If i can get this to work, it would be soooooooooooooo great, but as i said, i need your guidance, step by step probably.
Thanks.

13 Nov 2010, 6:15 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Different headers for different pages? Is it possible?

For the header, you would edit /includes/templates/your_template/common/tpl_header.php.

The fade-in slideshow is a whole different animal, and you should read the recent threads about using it.

I have just been helping someone with multiple header images, so you can look at my recent posts to see how to do that.

13 Nov 2010, 6:19 PM
#12
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Re: Different headers for different pages? Is it possible?

Thank you very very much. Considering various factors, i think i will focus on the animated display on the main page so i can have larger area to work with. However, i could not have done that without your help and your recommandations. Thanks!

14 Nov 2010, 2:15 AM
#13
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Re: Different headers for different pages? Is it possible?

Any suggestion where or how i should incorporate code to have that fade-in slideshow correctly on my main page? I tried through the Define page Editor but although i can insert it as an image (entering the path to the htm file, and SEEING it in the preview), i only see a red X in the window and on the actual page. I am probably missing something but what?

See how it looks right now: http://creationcassel.com/storetest

Thank you for your patience.