Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default 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:

    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!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default 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.
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default 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! )

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

    Thanks again!

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,725
    Plugin Contributions
    13

    Default 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.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  5. #5
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Re: How to determine $box_id

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

 

 

Similar Threads

  1. How do I determine whether I'm logged in using PHP?
    By bparker in forum General Questions
    Replies: 2
    Last Post: 2 Jul 2012, 10:42 PM
  2. How to determine current EZpage link/URL?
    By monkeyboy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Dec 2009, 09:16 PM
  3. where to find $box_id?
    By maxvenum in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 5 Aug 2009, 12:40 AM
  4. How to determine current page
    By MyGreyGoose in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 15 Nov 2008, 12:52 AM
  5. How to determine customers connection rate
    By JeffD in forum General Questions
    Replies: 10
    Last Post: 7 Nov 2006, 11:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg