Zen Cart Logo
Forums / Bug Reports / [Done v1.3.7.1] #indexHomeBody - not working

[Done v1.3.7.1] #indexHomeBody - not working

Locked

Views: 9,543

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
31 Dec 2006, 10:18 AM
#1
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

[Done v1.3.7.1] #indexHomeBody - not working

DrByte:

No, that stylesheet entry is exactly as intended.

Thank you for the info.

Just finished updating 1.36 to 1.37. One related question. The 1.37 announcement stated that #indexHomeBody was added to identify the "home" page. However I cannot locate that style class anywhere in any of the 1.37 files including stylesheet.css.

Woody

31 Dec 2006, 12:44 PM
#2
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [Done v1.3.7.1] #indexHomeBody - not working

It looks like #indexHomeBody is being generated dynamicly in tpl_main_page.php :

  $body_id = ($this_is_main_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
```doesn't it show when you look at the main_page HTML source?
31 Dec 2006, 3:35 PM
#3
moxy avatar

moxy

New Zenner

Join Date:
Jul 2006
Posts:
24
Plugin Contributions:
0

Re: [Done v1.3.7.1] #indexHomeBody - not working

paulm:

doesn't it show when you look at the main_page HTML source?
Now, I'm no expert here – and this is my very first upgrade (1.3.6 > 1.3.7) – but I'm not seeing this id in the body tag of my main page either. Other new functionalities seem to be present (such as the Breadcrumb switch for the main page to turn it off there)

I checked the tpl_main_page.php and it seems to have the code referenced above - I even put that file in my custom template folder under the common/ folder - but it does not seem to be adding the id attribute "indexHomeBody" to the source of the rendered main page.

Is there another file that I may have missed that impacts this function?

31 Dec 2006, 6:52 PM
#4
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: [Done v1.3.7.1] #indexHomeBody - not working

paulm:

It looks like #indexHomeBody is being generated dynamicly in tpl_main_page.php :

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

<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>> ```doesn't it show when you look at the main_page HTML source?

Oh I see <body id="indexBody">.

I was looking for #indexHomeBody.

So I'm still not sure about how all the above relates. I have more to learn about how CSS and Zen Cart work together. The more I think I know the more I find the less I know ;-)

Woody

31 Dec 2006, 6:54 PM
#5
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: [Done v1.3.7.1] #indexHomeBody - not working

Unless you have a style that you want only on the index, you don't need to worry about it.

31 Dec 2006, 7:01 PM
#6
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [Done v1.3.7.1] #indexHomeBody - not working

Kim is right of course.

I only posted the piece of code to make clear that the tag is generated dynamicly, because I already suspected that that was the reason you could not find it in the files.

But if you do need it, it should show in the HTML source of the index page (haven't had time to install 1.3.7 and take a look yet, I am afraid that will have to wait until next year ;-) )

31 Dec 2006, 7:16 PM
#7
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: [Done v1.3.7.1] #indexHomeBody - not working

Kim:

Unless you have a style that you want only on the index, you don't need to worry about it.

Huh? I am certainly not "worrying" about it. The point is I am trying to learn how the functionality works so I can utilize it! I am not a CSS expert so I will go to my corner and experiment. ;-)

And thanks Paul for posting that code. That was indeed helpful.

Happy New Year!

Woody

31 Dec 2006, 7:28 PM
#8
moxy avatar

moxy

New Zenner

Join Date:
Jul 2006
Posts:
24
Plugin Contributions:
0

Re: [Done v1.3.7.1] #indexHomeBody - not working

Kim:

Unless you have a style that you want only on the index, you don't need to worry about it.

That's true, Kim, except my concern is to establish whether this is an error that I have made during the upgrade process or not. To clarify, I am aware that I will need to add the id #indexHomeBody to my stylesheet. The issue is that it should be generated dynamically into the source at the body element i.e. <body id="indexHomeBody">. Truth be told, in the not too distant future, I definitely see myself requiring this, so I would like to hear from others who have upgraded to 1.3.7 as to whether or not it works out of the box.

Woodyman: you're seeing the same thing I am in your source, but in fact it seems to me that you should be seeing the <body id="indexHomeBody"> on the main page source. The code that was quoted from tpl_main_page.php...

$body_id = ($this_is_main_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>

...seems to be providing that by first printing the variable form of "indexHome" and then in the second line it tacks on the "Body", making "indexHomeBody". I'm describing this poorly (I'm no php genius) but that seems to be what it's doing.

Again, thanks for discussing this, folks. I'm in my first ZC upgrade and I really want to find the best way to perform it for the future, when the site is live. It's a bit of a dodgy process, I find, simply because of the range of the cart; I just need to get comfortable enough that I have done in correctly to rely on the process a little bit.

31 Dec 2006, 9:38 PM
#9
clydejones avatar

clydejones

Deceased

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

Re: [Done v1.3.7.1] #indexHomeBody - not working

paulm:

Kim is right of course.

I only posted the piece of code to make clear that the tag is generated dynamicly, because I already suspected that that was the reason you could not find it in the files.

But if you do need it, it should show in the HTML source of the index page (haven't had time to install 1.3.7 and take a look yet, I am afraid that will have to wait until next year ;-) )

It doesn't show <body id="indexHomeBody"> it only shows as <body id="indexBody">

1 Jan 2007, 12:13 AM
#10
ajeh avatar

ajeh

Oba-san

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

Re: [Done v1.3.7.1] #indexHomeBody - not working

That statement would actually work better using:

$this_is_home_page

thanks for the update ... :cool:

1 Jan 2007, 1:06 AM
#11
clydejones avatar

clydejones

Deceased

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

Re: [Done v1.3.7.1] #indexHomeBody - not working

Ajeh:

That statement would actually work better using:

$this_is_home_page

thanks for the update ... :cool:

That did it!

1 Jan 2007, 1:12 AM
#12
ajeh avatar

ajeh

Oba-san

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

Re: [Done v1.3.7.1] #indexHomeBody - not working

Thanks for the update that changing the $this_is_main_page to $this_is_home_page makes the $body_id set correctly for the home page vs any other page! :smile:

1 Jan 2007, 4:58 PM
#13
moxy avatar

moxy

New Zenner

Join Date:
Jul 2006
Posts:
24
Plugin Contributions:
0

Re: [Done v1.3.7.1] #indexHomeBody - not working

Worked for me too! Thanks, folks.

For a minute there, I thought I was losing my marbles!

Happy New Year, everyone.

11 Sep 2007, 6:33 PM
#14
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: [Done v1.3.7.1] #indexHomeBody - not working

where does this have to be changed in every occurance of tpl_main_page.php?

15 Sep 2007, 10:26 AM
#15
dedj avatar

dedj

Zen Follower

Join Date:
Jan 2007
Posts:
129
Plugin Contributions:
0

Re: [Done v1.3.7.1] #indexHomeBody - not working

rxalex:

where does this have to be changed in every occurance of tpl_main_page.php?

swap $this_is_main_page into $this_is_home_page

approx line 51 in:
/includes/templates/template_default/common/tpl_main_page.php

30 Jan 2008, 7:17 PM
#16
abwhitney avatar

abwhitney

New Zenner

Join Date:
Jan 2008
Posts:
33
Plugin Contributions:
0

Re: [Done v1.3.7.1] #indexHomeBody - not working

dedj:

swap $this_is_main_page into $this_is_home_page

approx line 51 in:
/includes/templates/template_default/common/tpl_main_page.php

I"m on the latest and greatest zen-cart version (.8a) and yest when I DOM inspect, this body still has the id indexHomeBody yet I don't see this anywhere in the CSS. I have checked this file and it in fact says "$this_is_home_page" rather than main_page.

ideas?

30 Jan 2008, 7:23 PM
#17
gjh42 avatar

gjh42

Black Belt

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

Re: [Done v1.3.7.1] #indexHomeBody - not working

You won't see #indexHomeBody in your stylesheet unless you put it there to style something about the home page.

The tag is provided in the PHP code for anybody who needs it to use.