Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    50
    Plugin Contributions
    0

    Default Customizing Category Pages

    I want to have completely custom category pages. For some, they would simply list the products like zen cart already does so nicely. But on others, I want to have special banners, customized text, and completely different layout. Essentially, I would be writing custom HTML for those.

    What's the easiest way to do this? Is there a module, or something else? If not, do I just need to go into the category layout files and put big IF() statements around it for each category?

    Thanks for any help.

    TJ

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

    Default Re: Customizing Category Pages

    You could clone product_listing.php to product_listing2.php, and call for the appropriate one based on a category id or cPath test in /includes/modules/pages/index/main_template_vars.php (no override available; keep a backup and edit the core file)
    around line 130:
    PHP Code:
    } elseif ($category_depth == 'products' || zen_check_url_get_terms()) { 
    or around line 196:
    PHP Code:
      ////////////////////////////////////////////////////////////////////////////////////////////////////////////
      
    $tpl_page_body 'tpl_index_product_list.php';
      
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////
    } else { 
    Alternatively, you could do as the Column Layout Grid mod does and have sections in product_listing.php based on current category instead of on row/column setting.
    Last edited by gjh42; 10 Dec 2010 at 05:32 PM.

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

    Default Re: Customizing Category Pages

    Actually, considering this

    $tpl_page_body = 'tpl_index_product_list.php';

    you could probably put the conditional handling in a custom template copy of tpl_index_product_list.php, which would be better.
    /includes/templates/your_template/templates/tpl_index_product_list.php

    Sometimes the module file calls the tpl file, and sometimes it works the other way - I'm not sure why except that that is the way they were set up originally...

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

    Default Re: Customizing Category Pages

    Right, it's been a while since I've worked with the product listing page... the file that calls product_listing.php is /includes/templates/your_template/templates/tpl_modules_product_listing.php, which is called by tpl_index_product_listing.php.

    Each layer of these files does some layout work, so where you need to intervene depends on what kinds of modifications you want to make.

 

 

Similar Threads

  1. Customizing only one category description pages
    By stood in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Feb 2011, 01:08 PM
  2. customizing dif pages
    By christianstogether in forum General Questions
    Replies: 0
    Last Post: 22 Oct 2010, 06:07 PM
  3. customizing EZ pages
    By Elisa13 in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 16 Jan 2010, 02:54 PM
  4. Adding text and customizing Category Pages
    By mw4kids in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Dec 2009, 07:18 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