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

    Default Remove categories from front page

    Hey everyone,

    Is there a way to remove the categories box from the front page, but have it on everything else?

    I looked around the admin page but can't seem to find it.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Remove categories from front page

    Quote Originally Posted by bswinnerton View Post
    Is there a way to remove the categories box from the front page, but have it on everything else?

    I looked around the admin page but can't seem to find it.
    In the current version there are no admin controls to selectively determine which page a certain sidebox will display on.

    You'll have to edit your sidebox code to do that. Namely add a check for $this_is_home_page around all the logic in your custom version of /includes/modules/sideboxes/YOURTEMPLATE/categories.php
    .

    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
    May 2008
    Posts
    33
    Plugin Contributions
    0

    Default Re: Remove categories from front page

    Quote Originally Posted by DrByte View Post
    You'll have to edit your sidebox code to do that. Namely add a check for $this_is_home_page around all the logic in your custom version of /includes/modules/sideboxes/YOURTEMPLATE/categories.php
    Hi,
    I did that, but the categories sidebox is showing anyway on the mainpage.

    What did I do wrong?

    regards, anna

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Remove categories from front page

    anniti,
    I did that, but the categories sidebox is showing anyway on the mainpage.
    You might elaborate a bit more on what it is that you did???
    Zen-Venom Get Bitten

  5. #5
    Join Date
    May 2008
    Posts
    33
    Plugin Contributions
    0

    Default Re: Remove categories from front page

    hi Kobra,
    I added


    if ($this_is_home_page) {
    $show_featured = false;
    } else {
    $show_featured =true;
    }

    <?php


    HERE!!!!!

    $main_category_tree = new category_tree;
    $row = 0;
    $box_categories_array = array();

    // don't build a tree when no categories
    $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1");
    if ($check_categories->RecordCount() > 0) {
    $box_categories_array = $main_category_tree->zen_category_tree();
    }

    require($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php');

    $title = BOX_HEADING_CATEGORIES;
    $title_link = false;

    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    ?>


    regards, anna

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

    Default Re: Remove categories from front page

    Mine does this properly, and the categories.php code looks like this: (Not sure why the code double-spaced when I pasted it.)


    Code:
    <?php
    
    /**
    
     * categories sidebox - prepares content for the main categories sidebox
    
     *
    
     * @package templateSystem
    
     * @copyright Copyright 2003-2005 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: categories.php 2718 2005-12-28 06:42:39Z drbyte $
    
     */
    
      if ($this_is_home_page) {
    
        $show_categories = false;
    
      } else {
    
        $show_categories = true;
    
      }
    
    
    
      if ($show_categories == true)
    
    {
    
        $main_category_tree = new category_tree;
    
        $row = 0;
    
        $box_categories_array = array();
    
    
    
    // don't build a tree when no categories
    
        $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1");
    
        if ($check_categories->RecordCount() > 0) {
    
          $box_categories_array = $main_category_tree->zen_category_tree();
    
        }
    
    
    
        require($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php');
    
    
    
        $title = BOX_HEADING_CATEGORIES;
    
        $title_link = false;
    
    
    
        require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    
    }
    
    ?>

  7. #7
    Join Date
    Jun 2003
    Posts
    33,720
    Plugin Contributions
    0

    Default Re: Remove categories from front page

    Your URL? What template are you using?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  8. #8
    Join Date
    May 2008
    Posts
    33
    Plugin Contributions
    0

    Default Re: Remove categories from front page

    hi Steve sh,
    Thank you so much, now it works.
    regards, anna

 

 

Similar Threads

  1. How to remove banners from front page
    By maritam in forum General Questions
    Replies: 1
    Last Post: 16 Apr 2016, 07:32 PM
  2. Remove Categories from front page?
    By mortypop in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 8 Jun 2011, 12:25 AM
  3. remove monthly specials box from front page
    By gsdcypher in forum Templates, Stylesheets, Page Layout
    Replies: 20
    Last Post: 21 Oct 2009, 09:44 AM
  4. Remove categories from top of page
    By tom50 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 16 Oct 2009, 04:23 PM
  5. Remove dash in front of Categories
    By roadliner in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 22 Sep 2008, 08:10 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