Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default help removing slider banner from every page except home page

    I only want the slider to be on home page. Slider uses Banners Header Position 1, 2 and 3 for the slide images. I really wanted to figure this out by myself, but I don't think that's going to happen. I removed some slider code from the template file '/common/tpl_main_page.php' but that removed the slider from every page, including the home page, so I put the original back. There aren't very many pages to this template, so if someone could steer me in the right direction, I certainly don't mind going to each page and looking for what I need to look for. I looked in other pages, such as tpl_contact_us_default.php, tpl_modules_main_product_image.php, tpl_shopping_cart.php, etc,, but didn't see any similar code.

    Oh, sorry, I am using Zen V1.51, and I am talking about Alien Stemware Template. Template is for Zen v1.3.9 but the files from template only go in their own folder in includes/templates/alien-stemware. Since no system files overwritten I tried it and it seem to be working fine. It has a JS file with the settings (speed, etc) for the slider as well. The website is www.long-skateboards.com ... Any help, as usual, would be GREEEEEEATLY appreciated. thanks!

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

    Default Re: help removing slider banner from every page except home page

    Hopefully you still have that edited file tpl_main_page.php

    Create a folder in your custom template named "index"

    Place the file that currently exists in common into the index folder

    Upload your edited file to the common folder
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default Re: help removing slider banner from every page except home page

    Thanks Kobra, that ALMOST got it. Let me explain. Banner is gone from all non-home pages including contact, specials, etc. except any category that has more than 1 product. If category has only one product, banner is gone; if category has more than one product, banner shows back up. The code that I removed from the tpl_main_page.php was from line 96-151 and is in red. Did I start/stop at the correct place? ps. I added some categories if you need to take a look at it.. I tried pretty much every variation of removing code that I could come up with including changing that "(1)" to different numbers, but whatever I did usually just made the website pretty much disappear.. ha

    <?php
    /**
    * Common Template - tpl_main_page.php
    *
    * Governs the overall layout of an entire page<br />
    * Normally consisting of a header, left side column. center column. right side column and footer<br />
    * For customizing, this file can be copied to /templates/your_template_dir/pagename<br />
    * example: to override the privacy page<br />
    * - make a directory /templates/my_template/privacy<br />
    * - copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php<br />
    * <br />
    * to override the global settings and turn off columns un-comment the lines below for the correct column to turn off<br />
    * to turn off the header and/or footer uncomment the lines below<br />
    * Note: header can be disabled in the tpl_header.php<br />
    * Note: footer can be disabled in the tpl_footer.php<br />
    * <br />
    * $flag_disable_header = true;<br />
    * $flag_disable_left = true;<br />
    * $flag_disable_right = true;<br />
    * $flag_disable_footer = true;<br />
    * <br />
    * // example to not display right column on main page when Always Show Categories is OFF<br />
    * <br />
    * if ($current_page_base == 'index' and $cPath == '') {<br />
    * $flag_disable_right = true;<br />
    * }<br />
    * <br />
    * example to not display right column on main page when Always Show Categories is ON and set to categories_id 3<br />
    * <br />
    * if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {<br />
    * $flag_disable_right = true;<br />
    * }<br />
    *
    * @package templateSystem
    * @copyright Copyright 2003-2007 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_main_page.php 7085 2007-09-22 04:56:31Z ajeh $
    */

    // the following IF statement can be duplicated/modified as needed to set additional flags

    if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes _on_here,separated_by_commas,and_no_spaces')) ) {
    $flag_disable_right = true;
    }


    $header_template = 'tpl_header.php';
    $footer_template = 'tpl_footer.php';
    $left_column_file = 'column_left.php';
    $right_column_file = 'column_right.php';
    $body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
    ?>
    <body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>


    <div id="mainWrapper">
    <?php
    /**
    * prepares and displays header output
    *
    */

    if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_header = true;
    }
    require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>

    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper">
    <tr>
    <?php
    if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
    // global disable of column_left
    $flag_disable_left = true;
    }
    if (!isset($flag_disable_left) || !$flag_disable_left) {
    ?>

    <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT; ?>">
    <?php
    /**
    * prepares and displays left column sideboxes
    *
    */

    ?>
    <div id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td>
    <?php
    }
    ?>
    <td valign="top">



    <?php
    if(1){
    ?>

    <div class="banners">



    <div id="loopedSlider">
    <div class="container">
    <div class="slides">
    <!-- BOF- BANNER #2 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerOne"><?php echo zen_display_banner('static', $banner);?></div>
    <?php
    }
    }
    ?>
    <!-- EOF- BANNER #2 display -->
    <!-- BOF- BANNER #3 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerTwo"><?php echo zen_display_banner('static', $banner);?></div>
    <?php
    }
    }
    ?>
    <!-- EOF- BANNER #3 display -->
    <!-- BOF- BANNER #4 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerThree"><?php echo zen_display_banner('static', $banner);?></div>
    <?php
    }
    }
    ?>
    <!-- EOF- BANNER #4 display -->
    <!-- BOF- BANNER #4 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerFour"><?php echo zen_display_banner('static', $banner);?></div>
    <?php
    }
    }
    ?>
    <!-- EOF- BANNER #4 display -->
    </div>
    </div>
    <a href="#" class="previous">&nbsp;</a>
    <a href="#" class="next">&nbsp;</a>
    </div>


    </div>
    <?php
    }
    ?>





    <!-- bof breadcrumb -->

    <?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?>
    <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
    <?php } ?>
    <!-- eof breadcrumb -->

    <!-- bof upload alerts -->
    <?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?>
    <!-- eof upload alerts -->

    <?php
    /**
    * prepares and displays center column
    *
    */

    require($body_code); ?>

    <?php
    if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
    }
    }
    ?></td>

    <?php
    //if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' && $_SESSION['customers_authorization'] != 0)) {
    if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
    // global disable of column_right
    $flag_disable_right = true;
    }
    if (!isset($flag_disable_right) || !$flag_disable_right) {
    ?>
    <td id="navColumnTwo" class="columnRight" style="width: <?php echo COLUMN_WIDTH_RIGHT; ?>">
    <?php
    /**
    * prepares and displays right column sideboxes
    *
    */

    ?>
    <div id="navColumnTwoWrapper" style="width: <?php echo BOX_WIDTH_RIGHT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?></div></td>
    <?php
    }
    ?>
    </tr>
    </table>

    <?php
    /**
    * prepares and displays footer output
    *
    */

    if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_FOOTER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_footer = true;
    }
    require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');
    ?>

    </div>
    <!--bof- parse time display -->
    <?php
    if (DISPLAY_PAGE_PARSE_TIME == 'true') {
    ?>
    <div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Number of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo $db->queryTime(); ?></div>
    <?php
    }
    ?>
    <!--eof- parse time display -->
    <!--bof- banner #6 display -->

    <?php
    if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
    }
    }
    ?>
    <!--eof- banner #6 display -->
    </body>
    Last edited by Johnnycopilot; 13 Mar 2013 at 12:07 AM.

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

    Default Re: help removing slider banner from every page except home page

    Maybe this would do what you want and no need for the file in the index folder

    Just the part that you had in red with the addition of the if statement that I have highlighted
    Code:
    <?php
    if (!$this_is_home_page) {
    ?>
    
    <div class="banners">
    
    
    
    <div id="loopedSlider">
    <div class="container">
    <div class="slides">
    <!-- BOF- BANNER #2 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerOne"><?php echo zen_display_banner('static', $banner);?></div>
    <?php
    }
    }
    ?>
    <!-- EOF- BANNER #2 display -->
    <!-- BOF- BANNER #3 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerTwo"><?php echo zen_display_banner('static', $banner);?></div>
    <?php
    }
    }
    ?>
    <!-- EOF- BANNER #3 display -->
    <!-- BOF- BANNER #4 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerThree"><?php echo zen_display_banner('static', $banner);?></div>
    <?php
    }
    }
    ?>
    <!-- EOF- BANNER #4 display -->
    <!-- BOF- BANNER #4 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerFour"><?php echo zen_display_banner('static', $banner);?></div>
    <?php
    }
    }
    ?>
    <!-- EOF- BANNER #4 display -->
    </div>
    </div>
    <a href="#" class="previous">&nbsp;</a>
    <a href="#" class="next">&nbsp;</a>
    </div>
    
    
    </div>
    <?php
    }
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default Re: help removing slider banner from every page except home page

    Ok, I did that (remove index folder, add that line to common/tpl_main_page.php); it had the opposite effect. It made the banner disappear from the home page, and show up on every other page.. that's the way it is now if you need to take a look. Thanks!!!

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

    Default Re: help removing slider banner from every page except home page

    Well this is supposed to work
    try editing
    if (!$this_is_home_page)
    to
    if ($this_is_home_page)

    dropping the !
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default Re: help removing slider banner from every page except home page

    Dropping the ! did it. From now on you will be referred to as King Kobra

  8. #8
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: help removing slider banner from every page except home page

    Try setting your left column & box widths to 185px instead of 180px
    Zen-Venom Get Bitten

  9. #9
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default Re: help removing slider banner from every page except home page

    I already tried that, but 180 seems to be as wide as they will get. I actually need it slightly wider because some of my categories wrap when you do a mouse-over, and I don't like that (well, they DID wrap, but I shortened the name).. I tried 185, 200, 250, 300... but they stop at 180 (incidentally, that's where the install instructions say to set them 180, so I guess the template is limiting the width??? ).. What I was fixin' to try (also) is to widen the entire template out a little. I don't want the website width floating (if that's the correct word); I want it a fixed width, but I do want a little wider. In one of my other zen cart sites I changed width from fixed to a %; but don't want that with this template. I was going to go back and look at my notes to see where I made that change, and attempt it on this template. If you can direct me to where I can make the column width change I would really appreciate it. I think I can find how to change the entire website width..? maybe.. ha
    Last edited by Johnnycopilot; 13 Mar 2013 at 03:38 AM.

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

    Default Re: help removing slider banner from every page except home page

    First set your desired width in Cofiguration > Layout Settings > both
    Column Width - Left
    and
    Column Width - Left - Boxes

    You appear to have both of these set to 180px.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How to put few products from every category on home page
    By RiazShahid in forum General Questions
    Replies: 3
    Last Post: 18 Dec 2015, 08:48 PM
  2. v150 Removing top banner from main page
    By dkruidhof in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 11 Apr 2015, 03:23 AM
  3. Removing image from home page....
    By Platinum Place in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Oct 2010, 11:23 AM
  4. turn offcategories-tab menu on every page except the main
    By lawman in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 22 Jul 2006, 03:17 PM

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