Thread: A few Questions

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jul 2006
    Posts
    125
    Plugin Contributions
    0

    Default A few Questions

    Ok, so in designing a template, I want to set column widths, that obviously only affect that template. So using the override system I would put the tpl_box_default_left.php file in the common folder withing templates. I got that bit easily enough. However, not being a whizz at php I don't quite know how to edit the page

    PHP Code:
    <!--// bof: <?php echo $box_id?> //-->
    <div class="leftBoxContainer" id="<?php echo str_replace('_''-'$box_id ); ?>" style="width: <?php echo $column_width?>">
    <h3 class="leftBoxHeading" id="<?php echo str_replace('_''-'$box_id) . 'Heading'?>"><?php echo $title?></h3>
    <?php echo $content?>
    </div>
    <!--// eof: <?php echo $box_id?> //-->
    If I want a width of 150px how would I change the php to let me do that? Or is it as simple as to:

    PHP Code:
    <!--// bof: <?php echo $box_id?> //-->
    <div class="leftBoxContainer" id="<?php echo str_replace('_''-'$box_id ); ?>" style="width:150px">
    <h3 class="leftBoxHeading" id="<?php echo str_replace('_''-'$box_id) . 'Heading'?>"><?php echo $title?></h3>
    <?php echo $content?>
    </div>
    <!--// eof: <?php echo $box_id?> //-->
    Secondly, I know to edit the tpl_header.php if I want to change the sitewide header. However I want to display a different header on different pages, is this done within the tpl_header.php file, or elsewhere. For example, I want a different header on the search pages, the cart pages, the checkout pages and the "account" pages. Is this possible? And how would I go about it?

    That's all the questions I can think of for the moment :)

    Thank you in advance

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: A few Questions

    Set the box width in the Admin> Configuration> Layout settings, not in the code.

  3. #3
    Join Date
    Jul 2006
    Posts
    125
    Plugin Contributions
    0

    Default Re: A few Questions

    Ah, but the thing is, I want it only to affect this template, so that when I switch templates it doesn't screw up with the widths being all wrong.

    Basically my end aim is to have more than one template on the site, which users can switch between. However, some templates have different column widths than standard, so I want to override the defualt width on these skins only.

    For example,
    Template 1 has a left column width of 150
    Template 2 has a left column width of 180

    If I set the width in admin to 150, template 2 will not display properly, is I set it to 180 template 1 will no longer display correctly. So I want template 1 to override the default width to 150 and template 2 to override it too 180.

    I was pretty sure this could be done by editing the tpl_box_default_left.php file as it reference the standard width:
    PHP Code:
    <div class="leftBoxContainer" id="<?php echo str_replace('_''-'$box_id ); ?>" style="width: <?php echo $column_width?>">
    I was thinking that I would simply remove the echo and input my own value...
    Like so:
    PHP Code:
    <div class="leftBoxContainer" id="<?php echo str_replace('_''-'$box_id ); ?>" style="width:180px">
    (*have to scroll to the right to see what I mean*)

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: A few Questions

    For your column-width issue,
    copy /includes/modules/column_left.php
    to
    /includes/modules/YOURTEMPLATE/column_left.php
    and edit line 25:
    PHP Code:
    $column_width BOX_WIDTH_LEFT
    becomes:
    PHP Code:
    $column_width '180px'
    .

    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.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: A few Questions

    I know to edit the tpl_header.php if I want to change the sitewide header. However I want to display a different header on different pages, is this done within the tpl_header.php file, or elsewhere. For example, I want a different header on the search pages, the cart pages, the checkout pages and the "account" pages. Is this possible? And how would I go about it?
    all pages get their header content from:
    includes/templates/YOURTEMPLATE/common/tpl_header.php
    UNLESS you have an override like this:
    includes/templates/YOURTEMPLATE/contact_us/tpl_header.php
    includes/templates/YOURTEMPLATE/advanced_search_result/tpl_header.php
    etc

    Now, if you simply want a different GRAPHIC, I'd suggest simply enhancing the common/tpl_header.php with a list of images relevant to certain pages, and just display the correct one.
    The key is to know that $current_page_base is the name from xxxxxxxxx in: "index.php?main_page=xxxxxxxxxx"
    .

    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.

  6. #6
    Join Date
    Jul 2006
    Posts
    125
    Plugin Contributions
    0

    Default Re: A few Questions

    Thank you very much DrByte.

    Is there anyway to do this with the sidebox width also?
    Im guessing it would be someting similar in the tpl_box_default_left.php file?

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: A few Questions

    Quote Originally Posted by Blue!
    Thank you very much DrByte.

    Is there anyway to do this with the sidebox width also?
    Im guessing it would be someting similar in the tpl_box_default_left.php file?
    BOX_WIDTH_LEFT .... is the sidebox width.
    .

    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.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: A few Questions

    If you want to set the overall column width, you do that in common/tpl_main_page.php, approx line 82:
    PHP Code:
     <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT?>">
    .

    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.

  9. #9
    Join Date
    Jul 2006
    Posts
    125
    Plugin Contributions
    0

    Default Re: A few Questions

    Ok, but forgive me for being a little bit confused

    I want to set a new column width and a new side box width, both being the same value.

    If I change the column width in includes/modules/column_left.php will this also change the sidebox width? Or do they need to be done seperately in different files?

    Sorry if this is obvious

  10. #10
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: A few Questions

    tpl_main_page.php builds the column ... in a table-cell. It uses the COLUMN_WIDTH_LEFT value to set width.
    It also sets the width of a containing DIV inside it (not mentioned above), using BOX_WIDTH_LEFT... which the boxes will all fit inside:

    tpl_main_page.php then uses the modules/column_left.php to build all the individual sideboxes inside that column, with BOX_WIDTH_LEFT as the fixed width of each of those sideboxes. (tpl_box_default_left.php to draw the "actual" content, based on information collected and prepared by the column_left.php module)

    So, really, there are three places in two files where you need to set this.
    .

    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. A few questions...
    By bendparker in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 21 Oct 2008, 06:17 PM
  2. A few questions
    By vito in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Aug 2008, 02:00 AM
  3. Few Questions on a few issues.
    By RSprinkel in forum General Questions
    Replies: 6
    Last Post: 10 Mar 2007, 12:02 PM
  4. Few Questions
    By maxpower1998 in forum General Questions
    Replies: 0
    Last Post: 13 Nov 2006, 10:35 AM

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