
Originally Posted by
gjh42
I just noticed a typo in one line of my code above. I left out a closing ) at the end of this line:
<h2 class="middleBoxHeading" id="middlebox<?php echo $i; ?>Heading"><?php echo constant('BOX_HEADING_MIDDLEBOX' . $i); ?></h2>
The lack of that would cause a fatal error, and adding it may fix the problem.
Okay.. Now we're cooking with Crisco!!!
That little change did the trick..
I went one step further, and I now have the middleboxes admin configurable. I can set the number of middleboxes I want to display along with whether or not the middleboxes show above or below the products categories (if categories on the main page are enabled) from the admin.
I'm a little unsure if the WAY I've implemented the categories positioning is correct. It works, but I can't help but wonder if there isn't a more effective way to do this.. Can you take a look and give me your thoughts??
Here's what the code in the tpl_index_categories.php looks like:
PHP Code:
<!-- Begin Main Page Middleboxes -->
<?php if (MIDDLEBOX_POSITION == 1) { ?>
<?php
if($this_is_home_page) require($template->get_template_dir('tpl_middlebox_controller.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_middlebox_controller.php');
?>
<?php } ?>
<!-- End Main Page Middleboxes -->
<?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 -->
<!-- Begin Main Page Middleboxes -->
<?php if (MIDDLEBOX_POSITION == 2) { ?>
<?php
if($this_is_home_page) require($template->get_template_dir('tpl_middlebox_controller.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_middlebox_controller.php');
?>
<?php } ?>
<!-- End Main Page Middleboxes -->