Forums / All Other Contributions/Addons / Tabbed Home Page Modules

Tabbed Home Page Modules

Views: 15,291

Results 61 to 80 of 112
8 Aug 2013, 5:35 PM
#61
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Tabbed Home Page Modules

Anne,

Any suggestions on removing the tabs if no products exist for that tab?

8 Aug 2013, 8:40 PM
#62
gam avatar

gam

Zen Follower

Join Date:
Aug 2007
Posts:
116
Plugin Contributions:
0

Re: Tabbed Home Page Modules

Thanks all. At least I know why the module wasn't working.

I'll look into the code changes and see what I can do.

Cheers
GAM

9 Aug 2013, 1:28 AM
#63
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Tabbed Home Page Modules

GAM:

Thanks all. At least I know why the module wasn't working.

I'll look into the code changes and see what I can do.

Cheers
GAM

I have this complete to work on all center boxes

It is set to open all by default, I have custom coded it to include a carousel though.

I will try to clean the code to include just the changes you need and post it here.

You can see that it is operational here:
www[.]zcadditions[.]com/responsive_templates/

9 Aug 2013, 1:47 AM
#64
gam avatar

gam

Zen Follower

Join Date:
Aug 2007
Posts:
116
Plugin Contributions:
0

Re: Tabbed Home Page Modules

LOL, I have just successfully modified tpl_index_categories.php to work and was about to paste the code here... and I see your post. ;)

Bah, pasting for reference anyway:

<?php
/**
 * Page Template
 *
 * Loaded by main_page=index<br />
 * Displays category/sub-category listing<br />
 * Uses tpl_index_category_row.php to render individual items
 *
 * @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_categories.php 4678 2006-10-05 21:02:50Z ajeh Modified by GAM to include Tabbed Home Page module (Picaflor Azul) with Categories 2013-08-09 $$
 */
?>

<script type="text/javascript">
  $(document).ready(function() {
    $('a.moduleBox').click(function() { // show selected module(s)
    // variables
      var popID = $(this).attr('rel');
      var popNAV = $(this).attr('class');
    // hide all wrappers and display the one selected
      $('.centerBoxWrapper').hide();
      // check if all or single selection
      if (popID != 'viewAll') {
        $('#' + popID).fadeIn();
      } else {
       $('.centerBoxWrapper').fadeIn();
      }
    });
  });
</script>

<div class="centerColumn" id="indexCategories">
<?php if ($show_welcome == true) { ?>
<h1 id="indexCategoriesHeading"><?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) { ?>
<div id="indexCategoriesMainContent" class="content"><?php
/**
 * require the html_define for the index/categories page
 */
  include($define_page);
?></div>
<?php } ?>

<?php } else { ?>
<h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1>
<?php } ?>

<?php
if (PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP == 'true') {
// categories_image
  if ($categories_image = zen_get_categories_image($current_category_id)) {
?>
<div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image, '', SUBCATEGORY_IMAGE_TOP_WIDTH, SUBCATEGORY_IMAGE_TOP_HEIGHT); ?></div>
<?php
  }
} // categories_image
?>

<?php
// categories_description
    if ($current_categories_description != '') {
?>
<div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description;  ?></div>
<?php } // categories_description ?>
<!-- BOF: Display grid of available sub-categories, if any -->
<?php
  if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) {
    // do nothing
  } else {
    // display subcategories
/**
 * require the code to display the sub-categories-grid, if any exist
 */
   require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php');
  }
?>
<!-- EOF: Display grid of available sub-categories -->
</div>

<div id="moduleMenu-wrapper">
<?php
// bof module navigation
$show_display_nav = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN);
if ($this_is_home_page) {
  echo '';
}
echo '<div id="moduleMenu">';
while (!$show_display_nav->EOF) {
  switch ($show_display_nav->fields['configuration_key']) {
    case 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS':
      echo '<span class="navOne moduleSpan"><a href="javascript:void(0)" rel="featuredProducts" class="navOne moduleBox">' . MODULE_TABS_FEATURED . '</a></span>';
    break;
    case 'SHOW_PRODUCT_INFO_MAIN_SPECIALS_PRODUCTS':
      echo '<span class="navThree moduleSpan"><a href="javascript:void(0)" rel="specialsDefault" class="navThree moduleBox">' . MODULE_TABS_SPECIALS . '</a></span>';
    break;
    case 'SHOW_PRODUCT_INFO_MAIN_NEW_PRODUCTS':
      echo '<span class="navTwo moduleSpan"><a href="javascript:void(0)" rel="whatsNew" class="navTwo moduleBox">' . MODULE_TABS_NEW . '</a></span>';
    break;
  }
  $show_display_nav->MoveNext();
}
echo '<span class="navFour moduleSpan"><a href="javascript:void(0)" rel="viewAll" class="navFour moduleBox">' . MODULE_TABS_ALL . '</a></span>';
echo '<br class="clearBoth" />';
echo '</div>';
// eof module navigation
?>

<?php
$show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);

while (!$show_display_category->EOF) {
  // //  echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS);
?>

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_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_CATEGORY_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_CATEGORY_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_CATEGORY_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
?>

To fix my headings I needed to include 'clear:left' in addition to adding my custom css to:
#indexHomeBody .centerBoxHeading {} in stylesheet_module_tabs.css

and include same css for .centerBoxHeading {} in stylesheet_module_tabs.css too

GAM

9 Aug 2013, 2:01 AM
#65
gam avatar

gam

Zen Follower

Join Date:
Aug 2007
Posts:
116
Plugin Contributions:
0

Re: Tabbed Home Page Modules

rbarbour:

I have this complete to work on all center boxes

It is set to open all by default, I have custom coded it to include a carousel though.

I will try to clean the code to include just the changes you need and post it here.

You can see that it is operational here:
www[.]zcadditions[.]com/responsive_templates/

Thanks for your efforts rbarbour. Appreciated. :-) The carousel is not a bad idea too. Hmm. I wouldn't mind being able to specify number of rows to display with prev/next/page# functionality. Hint. lol.

While coding the changes to tpl_index_categories.php, I was thinking that including 'categories' into the same Tabbed Home Page module as another tab. Might be an even better/nicer option. ....along with above suggestions.

Cheers
GAM

9 Aug 2013, 2:20 AM
#66
gam avatar

gam

Zen Follower

Join Date:
Aug 2007
Posts:
116
Plugin Contributions:
0

Re: Tabbed Home Page Modules

GAM:

...
To fix my headings I needed to include 'clear:left' in addition to adding my custom css to:
#indexHomeBody .centerBoxHeading {} in stylesheet_module_tabs.css

and include same css for .centerBoxHeading {} in stylesheet_module_tabs.css too

GAM
Urmm, this was probably the wrong way to go about fixing my float left issues with centerboxheading and 'upcoming products' when no new, featured or specials.

Have modified the code as follows:

Find:
// eof module navigation

Replace with:
echo '<br class="clearBoth" />';
// eof module navigation

As I have two files now (tpl_index_categories.php and tpl_index_default.php, I replaced in both.

Cheers

9 Aug 2013, 3:06 AM
#67
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Tabbed Home Page Modules

GAM:

LOL, I have just successfully modified tpl_index_categories.php to work and was about to paste the code here... and I see your post. ;)

Bah, pasting for reference anyway:

<?php /** * Page Template * * Loaded by main_page=index<br /> * Displays category/sub-category listing<br /> * Uses tpl_index_category_row.php to render individual items * * @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_categories.php 4678 2006-10-05 21:02:50Z ajeh Modified by GAM to include Tabbed Home Page module (Picaflor Azul) with Categories 2013-08-09 $$ */ ?> <script type="text/javascript"> $(document).ready(function() { $('a.moduleBox').click(function() { // show selected module(s) // variables var popID = $(this).attr('rel'); var popNAV = $(this).attr('class'); // hide all wrappers and display the one selected $('.centerBoxWrapper').hide(); // check if all or single selection if (popID != 'viewAll') { $('#' + popID).fadeIn(); } else { $('.centerBoxWrapper').fadeIn(); } }); }); </script> <div class="centerColumn" id="indexCategories"> <?php if ($show_welcome == true) { ?> <h1 id="indexCategoriesHeading"><?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) { ?> <div id="indexCategoriesMainContent" class="content"><?php /** * require the html_define for the index/categories page */ include($define_page); ?></div> <?php } ?> <?php } else { ?> <h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1> <?php } ?> <?php if (PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP == 'true') { // categories_image if ($categories_image = zen_get_categories_image($current_category_id)) { ?> <div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image, '', SUBCATEGORY_IMAGE_TOP_WIDTH, SUBCATEGORY_IMAGE_TOP_HEIGHT); ?></div> <?php } } // categories_image ?> <?php // categories_description if ($current_categories_description != '') { ?> <div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?> <!-- BOF: Display grid of available sub-categories, if any --> <?php if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) { // do nothing } else { // display subcategories /** * require the code to display the sub-categories-grid, if any exist */ require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php'); } ?> <!-- EOF: Display grid of available sub-categories --> </div> <div id="moduleMenu-wrapper"> <?php // bof module navigation [B]$show_display_nav[/B] = $db->Execute([B]SQL_SHOW_PRODUCT_INFO_MAIN[/B]); if ($this_is_home_page) { echo ''; } echo '<div id="moduleMenu">'; while (![B]$show_display_nav[/B]->EOF) { switch ([B]$show_display_nav[/B]->fields['configuration_key']) { case '[B]SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS[/B]': echo '<span class="navOne moduleSpan"><a href="javascript:void(0)" rel="featuredProducts" class="navOne moduleBox">' . MODULE_TABS_FEATURED . '</a></span>'; break; case '[B]SHOW_PRODUCT_INFO_MAIN_SPECIALS_PRODUCTS[/B]': echo '<span class="navThree moduleSpan"><a href="javascript:void(0)" rel="specialsDefault" class="navThree moduleBox">' . MODULE_TABS_SPECIALS . '</a></span>'; break; case '[B]SHOW_PRODUCT_INFO_MAIN_NEW_PRODUCTS[/B]': echo '<span class="navTwo moduleSpan"><a href="javascript:void(0)" rel="whatsNew" class="navTwo moduleBox">' . MODULE_TABS_NEW . '</a></span>'; break; } [B]$show_display_nav[/B]->MoveNext(); } echo '<span class="navFour moduleSpan"><a href="javascript:void(0)" rel="viewAll" class="navFour moduleBox">' . MODULE_TABS_ALL . '</a></span>'; echo '<br class="clearBoth" />'; echo '</div>'; // eof module navigation ?> <?php [B]$show_display_category[/B] = $db->Execute([B]SQL_SHOW_PRODUCT_INFO_CATEGORY[/B]); while (!$show_display_category->EOF) { // // echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS); ?> <?php if ($show_display_category->fields['configuration_key'] == '[B]SHOW_PRODUCT_INFO_CATEGORY_FEATURED_PRODUCTS[/B]') { ?> <?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'] == '[B]SHOW_PRODUCT_INFO_CATEGORY_SPECIALS_PRODUCTS[/B]') { ?> <?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'] == '[B]SHOW_PRODUCT_INFO_CATEGORY_NEW_PRODUCTS[/B]') { ?> <?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_CATEGORY_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 ?>
> 
> To fix my headings I needed to include 'clear:left' in addition to adding my custom css to:
> #indexHomeBody .centerBoxHeading {} in stylesheet_module_tabs.css
> 
> and include same css for .centerBoxHeading {} in stylesheet_module_tabs.css too
> 
> GAM

First, consider fixing the code **IN RED**, I have highlight the code** IN BLUE** for reference, otherwise you will notice some wacky things happening.
9 Aug 2013, 3:28 AM
#68
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Tabbed Home Page Modules

GAM:

Thanks for your efforts rbarbour. Appreciated. :-) The carousel is not a bad idea too. Hmm. I wouldn't mind being able to specify number of rows to display with prev/next/page# functionality. Hint. lol.

Very doable, look at the bestseller plugin, using the product_listing display would achieve that and be very easy to do.

GAM:

While coding the changes to tpl_index_categories.php, I was thinking that including 'categories' into the same Tabbed Home Page module as another tab. Might be an even better/nicer option. ....along with above suggestions.

Cheers
GAM

Also doable.

I do like the tabbed feature and Anne did a great job simplifying it, however I am looking for other alternatives do to the hassle it would be to custom code to turn off tabs with (no products). Very frustrating from a customer point of view. MO as well.

9 Aug 2013, 3:58 AM
#69
gam avatar

gam

Zen Follower

Join Date:
Aug 2007
Posts:
116
Plugin Contributions:
0

Re: Tabbed Home Page Modules

rbarbour:

First, consider fixing the code IN RED, I have highlight the code** IN BLUE** for reference, otherwise you will notice some wacky things happening.
Thank you. Didn't notice those.:ohmy:

I believe I've captured them all...

Modified tpl_index_categories.php (zen 1.5.1) for use with Tabbed Home Page v2
(Required when displaying Categories on Main page):

<?php
/**
 * Page Template
 *
 * Loaded by main_page=index<br />
 * Displays category/sub-category listing<br />
 * Uses tpl_index_category_row.php to render individual items
 *
 * @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_categories.php 4678 2006-10-05 21:02:50Z ajeh Modified by GAM to include Tabbed Home Page module (Picaflor Azul) with Categories 2013-08-09 $$
 */
?>

<script type="text/javascript">
  $(document).ready(function() {
    $('a.moduleBox').click(function() { // show selected module(s)
    // variables
      var popID = $(this).attr('rel');
      var popNAV = $(this).attr('class');
    // hide all wrappers and display the one selected
      $('.centerBoxWrapper').hide();
      // check if all or single selection
      if (popID != 'viewAll') {
        $('#' + popID).fadeIn();
      } else {
       $('.centerBoxWrapper').fadeIn();
      }
    });
  });
</script>

<div class="centerColumn" id="indexCategories">
<?php if ($show_welcome == true) { ?>
<h1 id="indexCategoriesHeading"><?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) { ?>
<div id="indexCategoriesMainContent" class="content"><?php
/**
 * require the html_define for the index/categories page
 */
  include($define_page);
?></div>
<?php } ?>

<?php } else { ?>
<h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1>
<?php } ?>

<?php
if (PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP == 'true') {
// categories_image
  if ($categories_image = zen_get_categories_image($current_category_id)) {
?>
<div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image, '', SUBCATEGORY_IMAGE_TOP_WIDTH, SUBCATEGORY_IMAGE_TOP_HEIGHT); ?></div>
<?php
  }
} // categories_image
?>

<?php
// categories_description
    if ($current_categories_description != '') {
?>
<div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description;  ?></div>
<?php } // categories_description ?>
<!-- BOF: Display grid of available sub-categories, if any -->
<?php
  if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) {
    // do nothing
  } else {
    // display subcategories
/**
 * require the code to display the sub-categories-grid, if any exist
 */
   require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php');
  }
?>
<!-- EOF: Display grid of available sub-categories -->
</div>

<div id="moduleMenu-wrapper">
<?php
// bof module navigation
$show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);
if ($this_is_home_page) {
  echo '';
}
echo '<div id="moduleMenu">';
while (!$show_display_category->EOF) {
  switch ($show_display_category->fields['configuration_key']) {
    case 'SHOW_PRODUCT_INFO_CATEGORY_FEATURED_PRODUCTS':
      echo '<span class="navOne moduleSpan"><a href="javascript:void(0)" rel="featuredProducts" class="navOne moduleBox">' . MODULE_TABS_FEATURED . '</a></span>';
    break;
    case 'SHOW_PRODUCT_INFO_CATEGORY_SPECIALS_PRODUCTS':
      echo '<span class="navThree moduleSpan"><a href="javascript:void(0)" rel="specialsDefault" class="navThree moduleBox">' . MODULE_TABS_SPECIALS . '</a></span>';
    break;
    case 'SHOW_PRODUCT_INFO_CATEGORY_NEW_PRODUCTS':
      echo '<span class="navTwo moduleSpan"><a href="javascript:void(0)" rel="whatsNew" class="navTwo moduleBox">' . MODULE_TABS_NEW . '</a></span>';
    break;
  }
  $show_display_category->MoveNext();
}
echo '<span class="navFour moduleSpan"><a href="javascript:void(0)" rel="viewAll" class="navFour moduleBox">' . MODULE_TABS_ALL . '</a></span>';
echo '<br class="clearBoth" />';
echo '</div>';
echo '<br class="clearBoth" />';
// eof module navigation
?>

<?php
$show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);

while (!$show_display_category->EOF) {
  // //  echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS);
?>

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_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_CATEGORY_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_CATEGORY_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_CATEGORY_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
?>

Cheers
GAM

9 Aug 2013, 4:06 AM
#70
gam avatar

gam

Zen Follower

Join Date:
Aug 2007
Posts:
116
Plugin Contributions:
0

Re: Tabbed Home Page Modules

rbarbour:

Very doable, -snip- Also doable.

I do like the tabbed feature and Anne did a great job simplifying it, however I am looking for other alternatives do to the hassle it would be to custom code to turn off tabs with (no products). Very frustrating from a customer point of view. MO as well.
Agreed. I see.

Hmm, I would like to take a look and try but worried I will never get this new build live if I keep tweaking and extending things :unsure:

Thanks for your help.

Cheers

9 Aug 2013, 2:45 PM
#71
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Tabbed Home Page Modules

GAM:

Thank you. Didn't notice those.:ohmy:

I believe I've captured them all...

Modified tpl_index_categories.php (zen 1.5.1) for use with Tabbed Home Page v2
(Required when displaying Categories on Main page):

<?php /** * Page Template * * Loaded by main_page=index<br /> * Displays category/sub-category listing<br /> * Uses tpl_index_category_row.php to render individual items * * @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_categories.php 4678 2006-10-05 21:02:50Z ajeh Modified by GAM to include Tabbed Home Page module (Picaflor Azul) with Categories 2013-08-09 $$ */ ?> <script type="text/javascript"> $(document).ready(function() { $('a.moduleBox').click(function() { // show selected module(s) // variables var popID = $(this).attr('rel'); var popNAV = $(this).attr('class'); // hide all wrappers and display the one selected $('.centerBoxWrapper').hide(); // check if all or single selection if (popID != 'viewAll') { $('#' + popID).fadeIn(); } else { $('.centerBoxWrapper').fadeIn(); } }); }); </script> <div class="centerColumn" id="indexCategories"> <?php if ($show_welcome == true) { ?> <h1 id="indexCategoriesHeading"><?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) { ?> <div id="indexCategoriesMainContent" class="content"><?php /** * require the html_define for the index/categories page */ include($define_page); ?></div> <?php } ?> <?php } else { ?> <h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1> <?php } ?> <?php if (PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP == 'true') { // categories_image if ($categories_image = zen_get_categories_image($current_category_id)) { ?> <div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image, '', SUBCATEGORY_IMAGE_TOP_WIDTH, SUBCATEGORY_IMAGE_TOP_HEIGHT); ?></div> <?php } } // categories_image ?> <?php // categories_description if ($current_categories_description != '') { ?> <div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description; ?></div> <?php } // categories_description ?> <!-- BOF: Display grid of available sub-categories, if any --> <?php if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) { // do nothing } else { // display subcategories /** * require the code to display the sub-categories-grid, if any exist */ require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php'); } ?> <!-- EOF: Display grid of available sub-categories --> </div> <div id="moduleMenu-wrapper"> <?php // bof module navigation $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY); if ($this_is_home_page) { echo ''; } echo '<div id="moduleMenu">'; while (!$show_display_category->EOF) { switch ($show_display_category->fields['configuration_key']) { case 'SHOW_PRODUCT_INFO_CATEGORY_FEATURED_PRODUCTS': echo '<span class="navOne moduleSpan"><a href="javascript:void(0)" rel="featuredProducts" class="navOne moduleBox">' . MODULE_TABS_FEATURED . '</a></span>'; break; case 'SHOW_PRODUCT_INFO_CATEGORY_SPECIALS_PRODUCTS': echo '<span class="navThree moduleSpan"><a href="javascript:void(0)" rel="specialsDefault" class="navThree moduleBox">' . MODULE_TABS_SPECIALS . '</a></span>'; break; case 'SHOW_PRODUCT_INFO_CATEGORY_NEW_PRODUCTS': echo '<span class="navTwo moduleSpan"><a href="javascript:void(0)" rel="whatsNew" class="navTwo moduleBox">' . MODULE_TABS_NEW . '</a></span>'; break; } $show_display_category->MoveNext(); } echo '<span class="navFour moduleSpan"><a href="javascript:void(0)" rel="viewAll" class="navFour moduleBox">' . MODULE_TABS_ALL . '</a></span>'; echo '<br class="clearBoth" />'; echo '</div>'; echo '<br class="clearBoth" />'; // eof module navigation ?> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY); while (!$show_display_category->EOF) { // // echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS); ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_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_CATEGORY_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_CATEGORY_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_CATEGORY_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 ?>
> 
> Cheers
> GAM


Thank you for posting your code.  I do have this on the list as a modification to include in a future module update ;)

Thanks,

Anne
9 Aug 2013, 2:48 PM
#72
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Tabbed Home Page Modules

rbarbour:

I do like the tabbed feature and Anne did a great job simplifying it, however I am looking for other alternatives do to the hassle it would be to custom code to turn off tabs with (no products). Very frustrating from a customer point of view. MO as well.

If you do not have any products in the new, specials, or featured, you can turn off this tab in admin--configuration--index listing

Thanks,

Anne

9 Aug 2013, 2:56 PM
#73
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Tabbed Home Page Modules

picaflor-azul:

If you do not have any products in the new, specials, or featured, you can turn off this tab in admin--configuration--index listing

Thanks,

Anne

The code posted was for the index_categories.php file, which would only show category specific new, special and featured products.

Turning the tab off will prevent those category specific tabs from appearing even if new, special and featured products exist for that category. Correct?

9 Aug 2013, 3:21 PM
#74
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Tabbed Home Page Modules

rbarbour:

The code posted was for the index_categories.php file, which would only show category specific new, special and featured products.

Turning the tab off will prevent those category specific tabs from appearing even if new, special and featured products exist for that category. Correct?

Ok, I understand ;) You would need to add some php code to the tpl_index_categories.php file to make the tabs show only when products are present.

Thanks,

Anne

9 Aug 2013, 8:16 PM
#75
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Tabbed Home Page Modules

picaflor-azul:

Ok, I understand ;) You would need to add some php code to the tpl_index_categories.php file to make the tabs show only when products are present.

Thanks,

Anne

Thanks Anne, along with the code posted for the sub-category page, I also have the code to include on shopping cart page if you would like me to post that as well.

I see no possible way to check without running additional sql query's to check for products available and is more code than I want to write at this time.

I will keep checking for updates, the "0" products feature for the tabs would be a great feature though.

10 Aug 2013, 6:38 AM
#76
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Tabbed Home Page Modules

Thank you so much for this great mod. I am having css problem that I need help with. The mod is installed at http://www.clevershoppers.com I uploaded the index_home.css but it's not applying to the home page. I am assuming that the css for the home page is suppose to over the value in stylesheet.css for .centerBoxWrapper but mine is not doing that and as a result I am getting an extra border lines (which is not pretty to the eyes). If I comment out .centerBoxWrapper from stylesheet.css then everything looks fine but of course it messes up the center boxes that needs it on other pages. I will greatly appreciate how to approach solving this problem.

Also, we have Zen Lightbox installed which loads jquery-1.4.4.min.js inside the jscript folder. This mod also loads another jquery from ```

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>

We also have CJLoader installed our site which is currently turned of at the moment.

We are running Zen Cart 1.5.1
Thank you!
10 Aug 2013, 2:14 PM
#77
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Tabbed Home Page Modules

BlessIsaacola:

Thank you so much for this great mod. I am having css problem that I need help with. The mod is installed at http://www.clevershoppers.com I uploaded the index_home.css but it's not applying to the home page. I am assuming that the css for the home page is suppose to over the value in stylesheet.css for .centerBoxWrapper but mine is not doing that and as a result I am getting an extra border lines (which is not pretty to the eyes). If I comment out .centerBoxWrapper from stylesheet.css then everything looks fine but of course it messes up the center boxes that needs it on other pages. I will greatly appreciate how to approach solving this problem.

Also, we have Zen Lightbox installed which loads jquery-1.4.4.min.js inside the jscript folder. This mod also loads another jquery from ```

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
> 
> We also have CJLoader installed our site which is currently turned of at the moment.
> 
> We are running Zen Cart 1.5.1
> Thank you!

I just looked at your site and it looks like you figured out the problem ;)

Thanks,

Anne
10 Aug 2013, 6:53 PM
#78
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Tabbed Home Page Modules

picaflor-azul:

I just looked at your site and it looks like you figured out the problem ;)

Thanks,

Anne

Thanks Anne! The problem is not solved. If you look on our home page, you will notice there's a line above the title for each tab (for example, right about "New Products For August" is a line). There's also a line at the bottom inside the wrapper. Basically, what's happening is the home page is taking the style from .centerBoxWrapper stylesheet.css which is not supposed to be the case. If you're able to provide direction that would be great. Thanks!

11 Aug 2013, 4:12 AM
#79
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Tabbed Home Page Modules

BlessIsaacola:

Thanks Anne! The problem is not solved. If you look on our home page, you will notice there's a line above the title for each tab (for example, right about "New Products For August" is a line). There's also a line at the bottom inside the wrapper. Basically, what's happening is the home page is taking the style from .centerBoxWrapper stylesheet.css which is not supposed to be the case. If you're able to provide direction that would be great. Thanks!

add this to the top of your index.home.css file:

div.centerBoxWrapper {border:0;}

11 Aug 2013, 10:00 PM
#80
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: Tabbed Home Page Modules

rbarbour:

add this to the top of your index.home.css file:

div.centerBoxWrapper {border:0;}

Thank you so much! That resolved my issue. You just made my day. Thank you!!!