Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    May 2007
    Posts
    10
    Plugin Contributions
    0

    Default Category images at top of main page instead of bottom?

    Hello all-- I have my categories set to always display on the main page. However, I would like the category images/icons to be displayed above the main text of the page rather than beneath it. Would it be possible to edit a template to achieve this effect? If so, which template controls this aspect of the layout of the main page (what is its name and where is it located)?

    Thank you. I'm enjoying learning Zen Cart, and the new book, "e-Start your Web Store with Zen Cart," is very nice and helpful.


    Steve

  2. #2
    Join Date
    May 2007
    Posts
    10
    Plugin Contributions
    0

    xhtml problem Re: Category images at top of main page instead of bottom?

    To clarify, what I'm trying to do is to cause the HTML code that "Configuration -> Layout Settings -> Categories - Always Show on Main Page" (= true) produces to appear above the "Define Page" text instead of below that text, on the main page.

    In other words, I'm trying to locate (find the name of) the file or files I would need to edit in order to change the logic and the order in which the XHTML code appears in the final constructed webpage for the main (first) page of the website.

    I hope that makes sense.

  3. #3
    Join Date
    Oct 2006
    Posts
    624
    Plugin Contributions
    0

    Default Re: Category images at top of main page instead of bottom?

    Try this: Use the Override System to edit the file includes/templates/template_default/templates/tpl_index_default.php.

    Shift this section of the code according to your preference.

    PHP Code:
    <?php if (DEFINE_MAIN_PAGE_STATUS >= and DEFINE_MAIN_PAGE_STATUS <= 2) { ?>
    <?php
    /**
     * get the Define Main Page Text
     */
    ?>
    <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
    <?php ?>
    Goh Koon Hoek, author of "e-Start Your Web Store with Zen Cart".
    Printed book: www.lulu.com/content/10576284
    Electronic book and Errata: www.cucumbermedia.com/store

  4. #4
    Join Date
    Oct 2006
    Posts
    624
    Plugin Contributions
    0

    Default Re: Category images at top of main page instead of bottom?

    To add to my previous post:

    If Categories - Always Show on Main Page = 0, edit the file "tpl_index_default.php"

    If Categories - Always Show on Main Page = 1, edit the file "tpl_index_categories.php"
    Goh Koon Hoek, author of "e-Start Your Web Store with Zen Cart".
    Printed book: www.lulu.com/content/10576284
    Electronic book and Errata: www.cucumbermedia.com/store

  5. #5
    Join Date
    May 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: Category images at top of main page instead of bottom?

    Thank you very much for your reply, and than you so much for writing your wonderful guide to (and explanation of) Zen Cart and its configuration details, "e-Start your Web Store with Zen Cart." My copy has helped me greatly to understand Zen Cart and to prioritize the tasks involved in setting up a web store by following the same order as is presented in the book, of familiarizing onself with and configuring Zen Cart .

  6. #6
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Category images at top of main page instead of bottom?

    I am having problems with that

    When i move the code.. i end up with the page text on the page TWICE.

    I can move the code to the very bottom of the page (under where i am displaying featured products on the index pageI cant seem to get it to work in this order

    1) Categories
    2) Page Text
    3) Featured Products

    Any ideas thanks?

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Category images at top of main page instead of bottom?

    You need to keep the moved code out of the centerbox loop. In tpl_index_categories.php about line 79,
    PHP Code:
    <!-- EOF: Display grid of available sub-categories -->
    <?php
    $show_display_category 
    $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);
    //put the require here
    while (!$show_display_category->EOF) {

  8. #8
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Category images at top of main page instead of bottom?

    Hi

    I do appreciate your reply.. however i cant get it to work

    I did this


    <!-- EOF: Display grid of available sub-categories -->
    <?php
    $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);
    <?php
    /**
    * require the html_define for the index/categories page
    */
    include($define_page);
    ?>
    while (!$show_display_category->EOF) {
    // // echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS);


    I did this in the tpl_index_categories.php


    Now i am getting a blank page

    I dont understand this wasted 2 days on it

    I cant understand why they decided to display the categories below the page text... surely you want to categories at TOP of the page

  9. #9
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Category images at top of main page instead of bottom?

    Ok

    Forget all that, ive fixed it. Here is the code for tpl_index_categories.php if you want the categories to display at the top of the main page when Categories - Always Show on Main Page is set to "1" (in layout settings)





    <?php
    /**
    * Page Template
    *
    * Loaded by main_page=index<br />
    * Displays category/sub-category listing<br />
    * Uses tpl_index_category_row.php to render individual items
    *
    * @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_categories.php 4678 2006-10-05 21:02:50Z ajeh $
    */
    ?>
    <div class="centerColumn" id="indexCategories">
    <?php if ($show_welcome == true) { ?>
    <h1 id="indexCategoriesHeading"><?php echo HEADING_TITLE; ?></h1>

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

    <!-- deprecated - to use - uncomment
    <?php if (TEXT_MAIN) { ?>
    <div id="" class="content"><?php echo TEXT_MAIN; ?></div>
    <?php } ?>-->

    <!-- deprecated - to use - uncomment
    <?php if (TEXT_INFORMATION) { ?>
    <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div>
    <?php } ?>-->

    <?php } else { ?>
    <h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1>
    <?php } ?>

    <?php
    if (PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP == 'true') {
    // categories_image
    if ($categories_image = zen_get_categories_image($current_category_id)) {
    ?>
    <div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image, '', SUBCATEGORY_IMAGE_TOP_WIDTH, SUBCATEGORY_IMAGE_TOP_HEIGHT); ?></div>
    <?php
    }
    } // categories_image
    ?>

    <?php
    // categories_description
    if ($current_categories_description != '') {
    ?>
    <div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description; ?></div>
    <?php } // categories_description ?>
    <!-- BOF: Display grid of available sub-categories, if any -->
    <?php
    if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) {
    // do nothing
    } else {
    // display subcategories
    /**
    * require the code to display the sub-categories-grid, if any exist
    */
    require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php');
    }
    ?>
    <!-- EOF: Display grid of available sub-categories -->
    <?php
    $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);
    include($define_page);
    while (!$show_display_category->EOF) {
    // // echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS);

    ?>

    <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?>
    <div id="indexCategoriesMainContent" class="content"></div>
    <?php } ?>

    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_FEATURED_PRODUCTS') { ?>
    <?php
    /**
    * display the Featured Products Center Box
    */
    ?>
    <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>
    <?php } ?>

    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_SPECIALS_PRODUCTS') { ?>
    <?php
    /**
    * display the Special Products Center Box
    */
    ?>
    <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?>
    <?php } ?>

    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_NEW_PRODUCTS') { ?>
    <?php
    /**
    * display the New Products Center Box
    */
    ?>
    <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?>
    <?php } ?>

    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_UPCOMING') { ?>
    <?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?>
    <?php
    $show_display_category->MoveNext();
    } // !EOF
    ?>
    </div>

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Category images at top of main page instead of bottom?

    I did this


    <!-- EOF: Display grid of available sub-categories -->
    <?php
    $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);
    <?php
    /**
    * require the html_define for the index/categories page
    */
    include($define_page);
    ?>
    while (!$show_display_category->EOF) {
    // // echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS);


    I did this in the tpl_index_categories.php


    Now i am getting a blank page
    Presumably you found these (red) extra bits of code in your first modification version, which would cause problems.
    <!-- EOF: Display grid of available sub-categories -->
    <?php
    $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);
    include($define_page);
    while (!$show_display_category->EOF) {

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. putting text at BOTTOM of main page rather than TOP
    By irishshopper in forum Basic Configuration
    Replies: 1
    Last Post: 12 Aug 2011, 04:10 PM
  2. Replies: 10
    Last Post: 16 Sep 2010, 05:18 PM
  3. sub category images left to right not top to bottom
    By imperialis in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 26 Aug 2008, 05:15 AM
  4. TOP category names. Can they be individual images instead?
    By askfritzdotcom in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 8 Jun 2007, 05:36 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR