Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Feb 2008
    Posts
    174
    Plugin Contributions
    0

    Default Adding content to main page above and below "Featured" products???

    I would like to (possibly) include custom content on my main page both above (which I have done) and BELOW the Featured Products that display in the main page, center area. Is this possible? and if so, how?

    /includes/modules/featured_products.php???

    Basically,

    HOME PAGE
    Menu Main Page (define) Content
    Featured Products here in 1 row
    MORE custom content

    THANKS!

  2. #2
    Join Date
    Feb 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: Adding content to main page above and below "Featured" products???

    Ok, I got adventurous and edited
    templates/mytemplate/common/tpl_main_page.php

    And managed to get additional content to show below the featured box just like I wanted it to ... BUT ...

    now it shows on EVERY page below everything.

    Is there a way to get it to JUST appear on the main page?

    (link)

  3. #3
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Adding content to main page above and below "Featured" products???

    You need to put some restriction on where the additional content must appear.

    Look here for some ideas:

    http://www.zen-cart.com/forum/showthread.php?t=55487
    20 years a Zencart User

  4. #4
    Join Date
    Feb 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: Adding content to main page above and below "Featured" products???

    Awesome! I just tried this:

    <!--additional content below featured products-->
    <?php if ($this_is_home_page)
    { ?>

    INSERT HTML HERE

    <?php } ?>

    <!-- eof additional content below featured -->

    THANK YOU!
    Last edited by aly22; 7 May 2009 at 03:57 PM. Reason: Figured it out thanks to schoolboy

  5. #5
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: Adding content to main page above and below "Featured" products???

    I've been experimenting for half an hour and can't figure out where exactly to put your code without messing up other parts of the page. A little more info, please, for us non-programmers!

    R

  6. #6
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: Adding content to main page above and below "Featured" products???

    As is often the case, I experimented a little more and figured it out right after the 7-minute limit to edit or cancel my previous post.

    It goes at line 132 (of tpl_main_page.php):

    PHP Code:
    ....  * prepares and displays center column
      *
      */
     require($body_code); ?>
    <!--additional content below featured products-->    
    <?php if ($this_is_home_page)
    ?> 
    YOUR TEXT OR CODE
    <?php ?>    
    <!-- eof additional content below featured -->
    <?php
      
    if (SHOW_BANNERS_GROUP_SET4 != ......
    Thanks!

    R

  7. #7
    Join Date
    Feb 2009
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding content to main page above and below "Featured" products???

    Will this work even if the featured products is not currently displayed?

  8. #8
    Join Date
    Feb 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: Adding content to main page above and below "Featured" products???

    This is exactly almost what I want !

    I have a bilingual website, how could I add a user defined box here, instead of just having content ? I can set up the box, I just don't know how to call it.

    Thank you !

  9. #9
    Join Date
    Feb 2009
    Posts
    78
    Plugin Contributions
    0

    help question Re: Adding content to main page above and below "Featured" products???

    Please, could someone help me out with this ?

    Thanks in advance

  10. #10
    Join Date
    Feb 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: Adding content to main page above and below "Featured" products???

    I have been testing with a few options here, and since I know almost nothing about php, I am kinda stuck here...

    I tried adding the define_page_2.php in my tpl_index_default.php file, but all I kkeep getting is a copy of the define_main_page.php content... Here is the code:

    Code:
    <?php
    /**
     * Page Template
     *
     * Main index page<br />
     * Displays greetings, welcome text (define-page content), and various centerboxes depending on switch settings in Admin<br />
     * Centerboxes are called as necessary
     *
     * @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_default.php 3464 2006-04-19 00:07:26Z ajeh $
     */
    ?>
    <div class="centerColumn" id="indexDefault">
    <h1 id="indexDefaultHeading"><?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 this section
    <?php if (TEXT_MAIN) { ?>
    <div id="" class="content"><?php echo TEXT_MAIN; ?></div>
    <?php } ?>-->
    
    <!-- deprecated - to use uncomment this section
    <?php if (TEXT_INFORMATION) { ?>
    <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div>
    <?php } ?>-->
    
    <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?>
    <?php
    /**
     * get the Define Main Page Text
     */
    ?>
    <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
    <?php } ?>
    
    <?php
      $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN);
      while (!$show_display_category->EOF) {
    ?>
    
    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_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_MAIN_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_MAIN_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_MAIN_UPCOMING') { ?>
    <?php
    /**
     * display the Upcoming Products Center Box
     */
    ?>
    <?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?>
    
    
    <?php
      $show_display_category->MoveNext();
    } // !EOF
    ?>
    
    <?php if (DEFINE_PAGE_2_STATUS >= 2 and DEFINE_PAGE_2_STATUS <= 3) { ?>
    <?php
    /**
     * get the Define Main Page Text
     */
    ?>
    <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
    <?php } ?>
    
    </div>
    I'm sure the problem lies in the require($define_page), but I have no clue how to fix this !

    Could someone please point me in the right direction ?

    Thank you !

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. "Show Featured Products on Main Page" set to 1 does nothing
    By ekon79 in forum Basic Configuration
    Replies: 10
    Last Post: 1 Mar 2011, 04:24 PM
  2. Replies: 1
    Last Post: 10 Feb 2011, 06:36 AM
  3. How to: new/featured main page - "buy now/details" change to "design" with attributes
    By ladybugmom in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Jan 2011, 11:23 AM
  4. Adding Manufacturer Name to "Featured Products" as Main Page
    By jenniferuth in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Apr 2010, 10:49 PM
  5. make product details show up in "featured products" center box on main page
    By traypup in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Mar 2009, 01:41 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