Forums / Templates, Stylesheets, Page Layout / Different header for different product categories possible?

Different header for different product categories possible?

Locked

Views: 2,481

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
12 Dec 2006, 12:22 PM
#1
rotkale avatar

rotkale

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Different header for different product categories possible?

Hi all ^^

Im having a problem with this... I have full html layout of our webstore ready and our header changes depending on category of products. Is it possible to implement this to zen cart too?

I tried to just not use any layout in header, footer and just build the whole page with for example "tpl_index_default.php" file. This works fine with just static pages, but when trying to do this in product listinings it becomes troublesome.

Like you see im new with zen cart ^^;;

Thanks for advance!

  • Rotkale
12 Dec 2006, 2:21 PM
#2
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Different header for different product categories possible?

You can use "per page stylesheets" to accompliish this.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

12 Dec 2006, 2:25 PM
#3
rotkale avatar

rotkale

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Different header for different product categories possible?

clydejones:

You can use "per page stylesheets" to accompliish this.

Thanks for fast reply. This works even when working with images?

12 Dec 2006, 2:34 PM
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Different header for different product categories possible?

Yep,

for instance in the stylesheet.css you use for for your main page you have this declaration:

#logoWrapper {
background: url(../images/your_main_image.jpg);
}

now create a stylesheet for category one and change it:

the stylesheet would be named c_1.css and would place this declaration along with any others you might need to style the page.

#logoWrapper {
background: url(../images/category_one_image);
}

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

13 Dec 2006, 7:22 AM
#5
rotkale avatar

rotkale

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Different header for different product categories possible?

clydejones:

Yep,

for instance in the stylesheet.css you use for for your main page you have this declaration:

#logoWrapper {
background: url(../images/your_main_image.jpg);
}

now create a stylesheet for category one and change it:

the stylesheet would be named c_1.css and would place this declaration along with any others you might need to style the page.

#logoWrapper {
background: url(../images/category_one_image);
}

Thanks alot! I start trying that ^^

13 Dec 2006, 9:23 AM
#6
rotkale avatar

rotkale

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Different header for different product categories possible?

Hmmm,

I edited stylesheet.css and took #logoWrapper off the line it was earlier:

#headerWrapper, #contentMainWrapper, #logoWrapper, #cartBoxListWrapper, #ezPageBoxList, #cartBoxListWrapper ul, #ezPageBoxList ul, #mainWrapper, #popupAdditionalImage, #popupImage {
margin: 0em;
padding: 0em;
}

and made new section like this:

#logoWrapper {
background: url("Images/header_covington.jpg");
}

I tried that also without the ""
and put this in middle of html section of the header file:

<tr> <td colspan="2"> <div id="logoWrapper"></td> </tr>

But my header image wont appear at all ^^;; What am i doing wrong?

13 Dec 2006, 10:11 AM
#7
rotkale avatar

rotkale

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Different header for different product categories possible?

Oh i found solution for that problem above by using the full url (http://www.mysite.com/images/etc...)

Here is another question about header, in our layout we have jscript like this on header:

<td colspan="2"> <script LANGUAGE="JavaScript"> iArray=new Array( "Images/met_header1.jpg", "Images/met_header2.jpg", "Images/met_header3.jpg", "Images/met_header4.jpg"); ri=Math.floor(iArray.length*Math.random()); ri='<IMG SRC="'+ iArray[ri]+ '" BORDER=0>'; </script><script> document.write(ri); </script></td>

Is there anyway to use this kind of jscript header on product categories? Main site uses just static header like with code like i showed above.

Thanks in advance~

13 Dec 2006, 11:41 AM
#8
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Different header for different product categories possible?

and made new section like this:

#logoWrapper {
background: url("../Images/header_covington.jpg");
}

You forgot the portion highlighted in red

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

13 Dec 2006, 1:20 PM
#9
rotkale avatar

rotkale

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Different header for different product categories possible?

clydejones:

and made new section like this:

#logoWrapper {
background: url("../Images/header_covington.jpg");
}

You forgot the portion highlighted in red

Yeah i tried that too, but i only got it work with full url. My images folder is in store root.

About the question i asked above, the jscript random image thing, can i use category #logoWrapper to point to an js file? So the header image would change randomly like in the code i showed above? Or is there any other way to make it work?

Thanks~

13 Dec 2006, 1:57 PM
#10
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Different header for different product categories possible?

Sorry, I don't use the random image contribution so I can't give you any kind of definitive answer on its ins and outs.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

14 Dec 2006, 11:10 AM
#11
rotkale avatar

rotkale

New Zenner

Join Date:
Dec 2006
Posts:
26
Plugin Contributions:
0

Re: Different header for different product categories possible?

Found solution for the random header thing (if anyone interested~)

Used Clyde's category css example and put #logoWrapper like this:

#logoWrapper {
background: url(../Images/c_1/rotate.php);
}

Rotate.php code can be found from:

http://photomatt.net/scripts/randomimage

Thanks again Clyde for help~