Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to determine $box_id

How to determine $box_id

Locked

Views: 1,350

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
17 Aug 2007, 7:13 AM
#1
thomasw98 avatar

thomasw98

Zen Follower

Join Date:
Aug 2007
Location:
Eugene, OR
Posts:
166
Plugin Contributions:
0

How to determine $box_id

I am using a Template Monster template (I know, I know!), and they change the appearance of sideboxes according to the $box_id name. For example, in tpl_box_default_left, they have this code:

if ($box_id == 'categories')
 {
	$style_head = 'style1'; 
	$style_cont = 'style1';
 }

This then makes the categories sidebox display in a different way (i.e. it follows "style1" which is defined in another location).

I would like to continue to use this method to make other sideboxes follow specific styling guidelines, but need to know the $box_id of each sidebox. I thought I might find it by "viewing source", but it seems that many sideboxes do not have a specific div id="" (which is where I thought I would find the $box_id name).

Any suggestions? Thanks!

17 Aug 2007, 7:17 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: How to determine $box_id

If you look in your Admin->Tools->Layout Boxes Controller, you'll see the name of each box.
The $box_id comes from the sidebox's filename. In the case of "categories.php", the $box_id is "categories"
For "more_information.php", the $box_id is "more_information".

That said, the default Zen Cart styling concepts are done very differently, and entirely via the built-in CSS capabilities. Be sure you're using the approach that is most suitable and upgrade-friendly.

17 Aug 2007, 7:29 AM
#3
thomasw98 avatar

thomasw98

Zen Follower

Join Date:
Aug 2007
Location:
Eugene, OR
Posts:
166
Plugin Contributions:
0

Re: How to determine $box_id

Thanks. I also tried that earlier but it did not work. I guess there is some other strange function hidden somewhere.

I understand what you mean about Zen Cart and CSS. I am torn between following the existing Template Monster structure or gradually piece by piece rewriting it back to a proper Zen Cart structure. As you say, this would be much more upgradeable. (But also lots more work! :smile:)

I think in this case I will switch at least this portion to a CSS structure.

Thanks again!

17 Aug 2007, 9:05 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,768
Plugin Contributions:
9

Re: How to determine $box_id

Voice of experience here.

Time spent getting it right now will save MANY hours later. You may find that much can be done by plugging some of the TM images into a new custom directory.

One thing that bothered me in the military and I had the sign above my desk.> NEVER enough time to do it right but, ALWAYS enough time to do it over.

At least that's what they thought. I found practical application was far different.

17 Aug 2007, 10:20 PM
#5
thomasw98 avatar

thomasw98

Zen Follower

Join Date:
Aug 2007
Location:
Eugene, OR
Posts:
166
Plugin Contributions:
0

Re: How to determine $box_id

Thanks for your input. I took a few steps last night along that road.