Forums / General Questions / Huh??? <body id="indexHomeBody">?

Huh??? <body id="indexHomeBody">?

Locked

Started by zcnb on 23 Apr 2009, 6:08 PM · Views: 1,351

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
23 Apr 2009, 6:08 PM
#1
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Huh??? <body id="indexHomeBody">?

I am trying to troubleshoot some sloppy code that was written for me by someone else.

As part of the debug process, discovered that a generic Zen-Cart store, such as the one at http://www.livedemo.com/scripts/zencart/, has a <body id="**index**"> while my store has a <body id="**indexHomeBody**">.

I combed all my .php and .css files and found no reference to "indexHomeBody".

I then discovered that the line responsible for outputting the <body> id is:

<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>

Which is identical in both the generic Zen-Cart store code and my store's code.

I am now confused. How is it possible that a generic store code produces <body id="**index**"> when its code should be appending 'Body' to it?

What am I missing?

How do I find out which PHP file is responsible for outputting a certain part/segment of the resultant HTML code of a given page?

Thank you!

23 Apr 2009, 6:21 PM
#2
Kim avatar

Kim

Obaa-san

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

Re: Huh??? <body id="indexHomeBody">?

The cart at livedemo is very old - and doesn't do the indexHomeBody thing

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

23 Apr 2009, 6:35 PM
#3
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Huh??? <body id="indexHomeBody">?

Kim:

The cart at livedemo is very old - and doesn't do the indexHomeBody thing
Aha! That explains it is. For a while I didn't really know what to think. Thank you!

Is there a recommended method to find out which PHP file is responsible for which segment in the resultant HTML (that can be viewed by any browser using menu item View | Page Source)?

BTW, I found the following demo site (which seems to be newer) but it seems even weirder (no id for <body> and no .column_left).

23 Apr 2009, 6:44 PM
#4
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Huh??? <body id="indexHomeBody">?

The Firefox browser with the webdeveloper add-on is handy for at least finding the tags for this stuff. You can then use the admin>tools>developers toolkit to do some digging into which files contain the tags or constants.

There may also be some info on this in the wiki.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

23 Apr 2009, 6:53 PM
#5
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Huh??? <body id="indexHomeBody">?

afo:

The Firefox browser with the webdeveloper add-on is handy for at least finding the tags for this stuff.
Thanks. I am already using Firefox's Web Developer add-on. But it helps me mostly with finding the CSS id/class.

Currently, I am using mostly grep (recursively) to search for a certain keyword but this process is really not methodical.

I wish there were a way to correlate between a PHP file and an HTML segment.

As you know, the resultant HTML for a give page is pretty cohesive and doesn't provide the information I am looking for -- unless every PHP echo statement in Zen-Cart would be prefixed by a "This echo came from FILE line number LINE" :smile:.

Additional ideas are welcome.

23 Apr 2009, 7:31 PM
#6
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Huh??? <body id="indexHomeBody">?

zcnb:

Additional ideas are welcome.
Eurika! :clap: I just got an idea and I am rushing to share this with you:

I noticed that every Zen-Cart resultant HTML page contains "hints" as to where a segment comes from. Every such "segment" is basically surrounded by two comment lines. For example:

<!--bof-navigation display -->
...
...
<!--eof-navigation display -->

Now, all I have to do is 'grep' for that text. Wow! It was in front of my eyes all that time and I didn't notice it.

23 Apr 2009, 8:34 PM
#7
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Huh??? <body id="indexHomeBody">?

zcnb:

Now, all I have to do is 'grep' for that text.
Well, almost. Each PHP file section that "echo"s something begins and ends with:

<!--// bof: <?php echo $box_id; ?> //-->
...
...
<!--// eof: <?php echo $box_id; ?> //-->

So, I can't grep exactly on "navigation display"... Some way for correlating between $box_id and the PHP file needs to be found. Still, this is better than what I had before (groping in the dark).