Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2006
    Location
    Sacramento, CA
    Posts
    93
    Plugin Contributions
    0

    Default override tpl_categories.php on main_page only

    Is there a way to do this? I've seen lots of information about enabling or disabling the whole column, but I just want to change the categories layout on the home page. Even if I created a new sidebox, I don't see a way to enable different sideboxes within the column on specific pages...

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,828
    Plugin Contributions
    9

    Default Re: override tpl_categories.php on main_page only

    And what difference are you seeking?
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Mar 2006
    Location
    Sacramento, CA
    Posts
    93
    Plugin Contributions
    0

    Default Re: override tpl_categories.php on main_page only

    I've already completely customized this file. In retrospect I probably should have used a new sidebox instead since I'm not using any of the original functionality. You can see what's there in the left column of www.thesatinbutton.com.

    On the home page, since I added all the categories back in the center column (I just did that manually), I want to put paragraphs instead of bullets under each category heading on the left. The links will be embedded in the paragraphs, but with a little more text. The categories listed on the left are the ones I've chosen to focus on for seo & I'm creating content-rich silo pages that each will link to. (as with Baby Bunch & Mark Roberts links so far)

    I was going to leave the left column how it is now on all pages except the home page (or I could possibly revert it back to a true category listing with all the subs... - open for opinions on what's better taking into consideration both seo & conversions... that's another discussion, though).

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

    Default Re: override tpl_categories.php on main_page only

    You can look at the comments in the file /common/tpl_main_page.php and create one for your home page according to the conventions listed
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Mar 2006
    Location
    Sacramento, CA
    Posts
    93
    Plugin Contributions
    0

    Default Re: override tpl_categories.php on main_page only

    Thanks for your reply. I already tried this, but maybe I'm not doing it right. When I put a new file named tpl_categories.php here:

    includes/templates/my_template/index/tpl_categories.php

    ..the changes carried over to all pages, not just the home page. When I placed it here:

    includes/templates/my_template/main_page/tpl_categories.php

    ..nothing happened.

    Where should I put this file to make it only override on my home page?

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,828
    Plugin Contributions
    9

    Default Re: override tpl_categories.php on main_page only

    I suggested that you create a custom common/tpl_main_page.php file for your home page & not a tpl_categories.php
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Mar 2006
    Location
    Sacramento, CA
    Posts
    93
    Plugin Contributions
    0

    Default Re: override tpl_categories.php on main_page only

    Quote Originally Posted by kobra View Post
    I suggested that you create a custom common/tpl_main_page.php file for your home page & not a tpl_categories.php
    OK, so let's see if I've got this right. I'm going to take a tpl_main_page.php and basically replace this:

    <?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?>

    with my own content.

    Now, to make these changes show only on the home page, I've tried putting this file under a folder called index, but the changes carry over to all other pages I haven't done additional overrides for. I've tried putting it in a folder called main_page, and nothing happens. Do I need to only use one copy of tpl_main_page and place an if statement like this:

    if ($current_page_base == 'index' and $cPath == ''){
    $content .= 'my content here?';
    }

    I'm trying this, but I don't seem to be getting the syntax quite right.

  8. #8
    Join Date
    Jan 2004
    Posts
    65,266
    Blog Entries
    7
    Plugin Contributions
    226

    Default Re: override tpl_categories.php on main_page only

    I wouldn't worry about changing tpl_main_page.php for handling the sidebox.

    Instead, in your /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_categories.php file, add some logic to conditionally display your paragraphs instead of the usual bulletted category details.
    Code:
    if ($this_is_home_page == true) {
       build your home-page content here
    } else {
       put the regular sidebox content here
    }
    .

    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
    Mar 2006
    Location
    Sacramento, CA
    Posts
    93
    Plugin Contributions
    0

    Default Re: override tpl_categories.php on main_page only

    Thanks for all the advice. I think I've decided not to change it after all, but it's good to know. I think I'm going to take those links in the middle out of list form and make them smaller closer to the bottom. When I'd originally taken them out of my left column, my hits went way down, so I put them back on the page, but the two lists didn't look good next to each other.

 

 

Similar Threads

  1. v139h Mod to Template tpl_categories.php
    By chadrt in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Jan 2012, 03:53 AM
  2. Second main_page template possible? Do I attempt an override?
    By witchyweb in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 20 May 2009, 02:14 AM
  3. tpl_categories.php : any way to show all subcategories site-wide?
    By inthecomputer in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 18 Nov 2008, 11:41 PM
  4. Getting category ID in tpl_categories.php
    By tslav in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Aug 2008, 07:21 AM
  5. Coding css changes into 2 category 3 subcategory tpl_categories.php
    By dvasdekis in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 2 Sep 2007, 10:29 AM

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