Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding distinct ID to index page body tag

Adding distinct ID to index page body tag

Locked

Views: 1,518

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
5 Jul 2007, 3:12 PM
#1
swortis avatar

swortis

New Zenner

Join Date:
Mar 2007
Location:
Cambridge, MA
Posts:
59
Plugin Contributions:
0

Adding distinct ID to index page body tag

I would like to add a distinct ID to the body tag of the front (index) page only. Currently, ' body id="indexBody" ' prints for displays of categories as well, thus crimping the formatting the index page vs cateogories pages.

Anyone have an idea about how to accomplish this? Since this ID changes for product display, etc. it shouldn't seem too involved..

Thanks!

5 Jul 2007, 3:30 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding distinct ID to index page body tag

This already exists in Zen Cart:

<body id="indexHomeBody">

vs the other pages:

<body id="indexBody">
<body id="productinfoBody">
5 Jul 2007, 5:49 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding distinct ID to index page body tag

Without making any coding changes, you could use the per-page-stylesheet support which will let you specify different indexBody details depending on which category is being displayed at a given time.

You can find the details on how this works in the "css" folder of your site ... in the CSS_read_me.txt file

5 Jul 2007, 7:51 PM
#4
swortis avatar

swortis

New Zenner

Join Date:
Mar 2007
Location:
Cambridge, MA
Posts:
59
Plugin Contributions:
0

Re: Adding distinct ID to index page body tag

Very odd- that is not the case with the site I'm working on.. "indexBody" appears on the front page...

Ajeh:

This already exists in Zen Cart:

<body id="indexHomeBody"> ```vs the other pages: > ```php <body id="indexBody"> ``````php <body id="productinfoBody"> ```
5 Jul 2007, 8:26 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding distinct ID to index page body tag

What version of Zen Cart are you using ?

5 Jul 2007, 8:31 PM
#6
swortis avatar

swortis

New Zenner

Join Date:
Mar 2007
Location:
Cambridge, MA
Posts:
59
Plugin Contributions:
0

Re: Adding distinct ID to index page body tag

In /includes/templates/[your template]/common/tpl_main_page.php, the statement:

$body_id = ($this_is_main_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);

should actually read:

$body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);

I don't believe it's correct in the current version (1.3.7) download.

Ajeh:

This already exists in Zen Cart:

<body id="indexHomeBody"> ```vs the other pages: > ```php <body id="indexBody"> ``````php <body id="productinfoBody"> ```
5 Jul 2007, 8:48 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding distinct ID to index page body tag

Good point. That was reported as a bug back in about January. The fix you mention will address it as Ajeh mentioned.

To get things working for categories specifically, you'll need to use the per-page-stylesheet approach mentioned earlier.