Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Banner on Main Page Only

Banner on Main Page Only

Locked

Views: 4,943

Results 21 to 27 of 27
This thread is locked. New replies are disabled.
16 May 2007, 6:11 PM
#21
bradsmith avatar

bradsmith

New Zenner

Join Date:
Jan 2007
Posts:
50
Plugin Contributions:
0

Banner on Main Page Only

Nope, doesn't work... I went in an restored the template_default .php's to see if the banner would pop back up (meaning that for some reason, the over-ride wasn't working), but there still was no banner. This means, I guess, that the over-ride has worked thus far to prevent the banner from showing up on any page - but hasn't quite worked in making it show up on the main page.

Curious... So I guess the problem is with the index default code, right? I don't know where to paste it, here is where it lies with the rest of the code.

I feel like I'm close to "getting it"...

Close, yet so far.

<?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_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>



<?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
?>
</div>
16 May 2007, 7:46 PM
#22
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,606
Plugin Contributions:
0

Re: Banner on Main Page Only

Where are you putting the edited tpl_index_default.php? It also needs to be in the override directory.

16 May 2007, 7:57 PM
#23
bradsmith avatar

bradsmith

New Zenner

Join Date:
Jan 2007
Posts:
50
Plugin Contributions:
0

Re: Banner on Main Page Only

the edited index_default is here :

includes/templates/rickrushart/templates/tpl_index_default.php

Did I cut or paste the wrong code into the index default? That's the only thing I can think of... I've checked countless times to make sure that the banner is switched on, and the banner group that it's in, 'PreOrder', is supposed to be in the Header 3 position...

16 May 2007, 8:04 PM
#24
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,606
Plugin Contributions:
0

Re: Banner on Main Page Only

Are you using categories on the main page?

16 May 2007, 8:08 PM
#25
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,606
Plugin Contributions:
0

Re: Banner on Main Page Only

Aha! I hadn't looked at your site layout - you need to ad the banner code to the tpl_index_categories.php

16 May 2007, 8:35 PM
#26
bradsmith avatar

bradsmith

New Zenner

Join Date:
Jan 2007
Posts:
50
Plugin Contributions:
0

Re: Banner on Main Page Only

Woah, that did the trick! By adjusting where the code was in the index_categories, I was also able to limit the banner to just the front page. Sweet!

Thanks to all of you for helping me with this... I'll have to sit down and try and write a conclusion post to all of this, in case anyone in a similar jam comes across this thread.

16 May 2007, 8:47 PM
#27
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,606
Plugin Contributions:
0

Re: Banner on Main Page Only

:clap: Sorry - I never thought to peek at your site before sending you on a wild goose chase with the wrong index file.