Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2008
    Location
    PA
    Posts
    23
    Plugin Contributions
    0

    Default Modifying Centerboxes

    Thanks to all for posting their issues and especially thanks to those who posted the resolution as this has helped me tremendously.

    I downloaded 1.38a, installed on local server. I setup my overrides and working on modifying layout and testing. With my limited knowledge of php and css I am able to find where I need to make my changes to make things happen. However, now I am stumped.

    I turned off the right column via admin. So now the center column expands to fill the gap. What I am attempting to do is have the New product, Special, and feature centerboxes all on 1 row. I already changed it in admin to have 1 column I just cant trace it back to where I need to make the changes to have on the same line.

    I searched the forum and it seems back in Nov 2007 this was done but they did not post where the changes needed to be made to accomplish this.

    Any insight will be greatly appreciated.

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Modifying Centerboxes

    If I understand your question, you'll need this mod:

    http://www.zen-cart.com/index.php?ma...products_id=77

  3. #3
    Join Date
    Jul 2008
    Location
    PA
    Posts
    23
    Plugin Contributions
    0

    Default Re: Modifying Centerboxes

    Thanks for the post but not what I need. Here is a sample of how I want the centerboxes to show on the main page
    Attached Images Attached Images  

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Modifying Centerboxes

    Ah, I see. Not a bad idea.

    You have some major custom coding ahead of you.

    If it's important enough to pay for, there is a Commercial Help Wanted forum here.

  5. #5
    Join Date
    Jul 2008
    Location
    PA
    Posts
    23
    Plugin Contributions
    0

    Default Re: Modifying Centerboxes

    Ok I figured out one way to do it. These are the steps I took if someone wants to try it or even expand/improve on it or figures out an easier way, please dont hesitate to post.

    Went into admin - configuration - index listing and turned off SHOW NEW PRODUCTS/FEATURED PRODUCTS and SPECIAL PRODUCTS from the main page (changes values to 0)

    Went to bottom of index listing and changed New Products Columns Per Row, Featured Products Columns Per Row and Special Products Columns per row to 1
    Went into admin - configuration - maximum values changed New Products Module, Maximum Display of Featured Products - Main Page and Maximum Display of Special Products - Main Page to 1

    The above changes will also change how the boxes are displayed on other pages as far as how many items are displayed per centerbox. But for my project I am ok with it

    Assuming you have already created your override folders next step was to create a separate center box module. In /includes/templates/YOUR CUSTOM FOLDER/template create your template. My template is tpl_modules_aligned_centerboxes.php here is the coding in that template

    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" >
    <tr>
    <td width="34%" height="195" valign="top">
    <?php
    $zc_show_featured = false;
    include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_FEATURED_PRODUCTS_MODULE));
    ?>

    <?php if ($zc_show_featured == true) { ?>
    <div class="centerBoxWrapper" id="featuredProducts" >
    <?php
    /**
    * require the list_box_content template to display the product
    */
    require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
    ?>
    </div>
    <?php } ?>
    </td>
    <td width="34%" height="195" valign="top">
    <?php
    $zc_show_specials = false;
    include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_SPECIALS_INDEX));
    ?>

    <!-- bof: specials -->
    <?php if ($zc_show_specials == true) { ?>
    <div class="centerBoxWrapper" id="specialsDefault";>
    <?php
    /**
    * require the columnar_display template to show the products
    */
    require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
    ?>
    </div>
    <?php } ?>

    </td>
    <td width="34%" height="195" valign="top">
    <?php
    $zc_show_new_products = false;
    include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_NEW_PRODUCTS));
    ?>

    <!-- bof: whats_new -->
    <?php if ($zc_show_new_products == true) { ?>
    <div class="centerBoxWrapper" id="whatsNew" ;>
    <?php
    require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
    ?>
    </div>
    <?php } ?>
    <!-- eof: whats_new -->

    </tr>
    </table>


    Basically I created a table and copied the coding for the Special, Feature and whats new template modules and pasted it in the cells within the table

    Afterwords I copied the tpl_index_default.php to the same custom directory and removed the coding that I didnt need and this is what it looks like:

    <?php
    /**
    * Page Template
    *
    * Main index page<br />
    * Displays greetings, welcome text (define-page content), and various centerboxes depending on switch settings in Admin<br />
    * Centerboxes are called as necessary
    *
    * @package templateSystem
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_index_default.php 3464 2006-04-19 00:07:26Z ajeh $
    */
    ?>
    <div class="centerColumn" id="indexDefault">
    <h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

    <?php if (SHOW_CUSTOMER_GREETING == 1) { ?>
    <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
    <?php } ?>

    <img src="includes/templates/custom/images/homemain.jpg"> /** My Image */

    <?php
    $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN);
    while (!$show_display_category->EOF) {
    ?>

    <?php /**if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS') NEEDED TO COMMENT THIS OUT TO WORK - NOT SURE WHY*/ { ?>
    <?php
    /**
    * display the ALigned Center Box
    */
    ?>
    <?php require($template->get_template_dir('tpl_modules_aligned_centerboxes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_aligned_centerboxes.php'); ?>
    <?php } ?>/* CHANGE/ADD THIS TO REFLECT YOUR NEW MODULE */


    <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?>
    <?php
    /**
    * get the Define Main Page Text
    */
    ?>
    <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
    <?php } ?>


    <?php
    $show_display_category->MoveNext();
    } // !EOF
    ?>
    </div>


    Again this works for me. Hopefully some find it useful.

  6. #6
    Join Date
    Jul 2008
    Posts
    84
    Plugin Contributions
    0

    Default Re: Modifying Centerboxes

    Hi,
    I was looking for exactly the same thing.
    However, Im a novice and i find it really hard to understand. Kindly help me figure it out how does it work!!

  7. #7
    Join Date
    Jul 2008
    Posts
    84
    Plugin Contributions
    0

    Default Re: Modifying Centerboxes

    Hi,
    I was able to do as you said.Thanks a lot for your contribution.

    The site is:
    http://zencart.matchlex.com

    However, there seems to be a problem.
    The "New Products For July","Monthly Specials For July", "Featured Products"
    text is coming repetitively.
    That doesn't look too good.

    Can you suggest any solution?

    Regards,
    Chetan

  8. #8
    Join Date
    Jul 2008
    Location
    PA
    Posts
    23
    Plugin Contributions
    0

    Default Re: Modifying Centerboxes

    I'm Glad you can use it. In your template file remove this line

    <img src="includes/templates/custom/images/homemain.jpg"> /** My Image */
    Also Remove this line

    /* CHANGE/ADD THIS TO REFLECT YOUR NEW MODULE */

    It looks like you want to display more than 1 item per column. If so you need to change the height of the table. Look for

    <td width="34%" height="195" valign="top">

    and change the 195 until it shows all of the products. Probably try 400.

 

 

Similar Threads

  1. v154 Homepage centerboxes
    By Nick1973 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 19 Oct 2015, 12:03 PM
  2. Centerboxes
    By ideasgirl in forum General Questions
    Replies: 35
    Last Post: 4 Apr 2011, 02:35 PM
  3. adding new centerboxes?
    By MB1 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 11 Aug 2010, 09:15 PM
  4. Centerboxes Formatting
    By WellCool in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Apr 2009, 08:21 AM
  5. Adding Descriptions to Centerboxes
    By Globie in forum General Questions
    Replies: 11
    Last Post: 5 Nov 2008, 11:00 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