Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2011
    Posts
    13
    Plugin Contributions
    0

    Default Getting Main Page To Open With Category Plus Other Stuff

    I'd like to list the products in a certain category (ID=2) on the main page, under text and/or images defined as usual in includes/languages/english/html_includes/custom/define_main_page.php. This would seem to be straightforward.

    However, when in Layout Settings I set "Main Page - Opens with Category" to the category ID, the text/images disappear. They reappear if I set "Main Page - Opens with Category" to zero (or blank). So I can get one or the other, but not both. Is this normal?

    Obviously I have "Categories - Always Show on Main Page" set to 1. Version is 1.3.9h.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Getting Main Page To Open With Category Plus Other Stuff

    There are 3 index templates for:

    1 Normal index when no categories are displayed:
    tpl_index_default.php

    2 Index for when there are Categories displayed, such as you click on categories_id 3 and it has subcategories:
    tpl_index_categories.php

    3 Index for when you are on a Category with just Products for the Product Lising to display:
    tpl_index_product_listing.php

    The first two, show the Define page for the:
    define_main_page.php

    The last one does not ...

    You could customize the third one to know when it is on the Home page with the variable:
    $this_is_home_page

    and add the Define page to it to display only when on the Home Page but not when on the Category navigation for the Product Listing ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Apr 2011
    Posts
    13
    Plugin Contributions
    0

    Default Re: Getting Main Page To Open With Category Plus Other Stuff

    Thank you for a very quick reply. I've now added the following code at the top of includes/templates/custom/templates/tpl_index_product_list.php (and it seems to work):

    <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2 and $this_is_home_page) { ?>
    <?php
    ?>
    <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
    <?php } ?>

    I copied it from tpl_index_default.php and added your suggestion of "if $this_is_home_page".

    I hope that I've understood you correctly and that I haven't upset anything else by making this modification!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Getting Main Page To Open With Category Plus Other Stuff

    Glad that this is now working for you ... thanks for posting the solution you used to display the define on the tpl_index_product_listing.php when that is being used as your Home page ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Apr 2011
    Posts
    13
    Plugin Contributions
    0

    Default Re: Getting Main Page To Open With Category Plus Other Stuff

    I should let you know that I've now decided to display featured products on the main page instead, and therefore the modification I made will not be getting a proper test.

    It may even be causing a problem, because though the featured products are showing on the main page, the Featured Listing in the Admin does not now seem to control how they display.

  6. #6
    Join Date
    Apr 2011
    Posts
    13
    Plugin Contributions
    0

    Default Re: Getting Main Page To Open With Category Plus Other Stuff

    Well, it wasn't the problem. I've reversed the modification I made to tpl_index_product_listing.php, but the Featured Listing in the Admin is still failing to controlling the featured products display on the main page.

  7. #7
    Join Date
    Nov 2004
    Posts
    53
    Plugin Contributions
    0

    Default Re: Getting Main Page To Open With Category Plus Other Stuff

    this solution helpt me 2... thank you

 

 

Similar Threads

  1. Open Main Category with Sub-Category
    By yaseent in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 11 Dec 2014, 12:27 PM
  2. Main page open with category and new product, Featured Product
    By jennydutch in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Jun 2014, 08:26 PM
  3. Getting sub category images to show up on the main category page
    By VigilantWine in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 16 Feb 2009, 09:45 AM
  4. Main page open in category view
    By Ripper in forum Basic Configuration
    Replies: 2
    Last Post: 22 Jan 2007, 07:23 AM
  5. category pages open with main page image
    By styledata in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 3 Jul 2006, 04:52 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