Index Template Files

Index template files are located in - Directory: Templates/index

The following document details the various template files that can be found in the index template directory, detailing specific calls you can make within each template. Both variable setting calls, and data calls listed below can be used in any index template file.

Index Variable Settings

You can pre-define various settings which determine how data is displayed using the following calls. All calls must be operated within PHP tags as follows:-

<?php $Template->Index->setProductMainFeatureLimit('8'); ?>

$Template->Index->setProductMainFeatureLimit('8')

This sets the number of Main Feature Product Items you want to display. This is also used for product specials too.

$Template->Index->setProductFeatureLimit('8')

This sets the number of Standard Product Items you want to display.

$Template->Index->setNewProductsFeatureLimit('14')

This call sets the number of new products you want to display.

Index Data Calls

$Template->Index->getProductSpecials()

Gets the Product Specials and outputs them as a grid of products. Used as follows:

<?php echo $Template->Index->getProductSpecials(); ?>

$Template->Index->getNewProducts()

Gets the New Products and outputs them as a grid of products.

$Template->Index->getProductMainFeatures()

Gets the Featured Products grid

$Template->Index->getProductFeatures()

Gets a random grid of products

$Template->Index->getMainAdvert()

Returns the Main Advert

home.template.php

File Sample

This file is the main template for the homepage of your website.

Sample of standard file:

<?php #echo $Template->getBannersMain(); ?>
<div class="boxFeature_wrap">
  <?php echo $Template->Index->getProductMainFeatures(); ?>
</div>
  <div style="width:100%; color: #fff">----------------------------------------------------------------------------------------------</div>
<div class="boxFeature_wrap">
<?php echo $Template->Index->getProductFeatures(); ?>
</div>

You can customise the files to do alot more. The following example uses a simple PHP if statement to decide what to display on the screen depending on the status of the returned $_GET['show'] variable posted in the URL. Here we see the use of an offers page, and a new products page. You can customise pages using various PHP calls to the redbeckmedia library.

Sample Customised file:

<?php
/* ########################################################################### *\
   ###     HOME.TEMPLATE.PHP - 22/11/2007 - Copyright RedbeckGroup 2007    ###
\* ########################################################################## */
# Uses short description
# $Template->TemplateIndex->setShowShortDescription();
 $Template->Index->setUseProductFeatureFooter();
 
?>
 
<?php 
if (isset($_GET['show']) && $_GET['show'] == 'specials')
{
     $Template->Index->setProductMainFeatureLimit('8');
?>
<?php #echo $Template->getBannersMain(); ?>
<div class="boxFeature_wrap">
 
  <?php echo $Template->Index->getProductSpecials(); ?>
</div>
<?php
} else if (isset($_GET['show']) && $_GET['show'] == 'newProducts')
{
     $Template->Index->setNewProductsFeatureLimit('14');
?>
<?php #echo $Template->getBannersMain(); ?>
<div class="boxFeature_wrap">
 
  <?php echo $Template->Index->getNewProducts(); ?>
</div>
<?php
} else {
?>
 
<?php #echo $Template->getBannersMain(); ?>
<div class="boxFeature_wrap">
  <?php echo $Template->Index->getProductMainFeatures(); ?>
</div>
  <div style="width:100%; color: #fff">----------------------------------------------------------------------------------------------</div>
<div class="boxFeature_wrap">
<?php echo $Template->Index->getProductFeatures(); ?>
</div>
 
<?php
}
?>

category.template.php

File Sample

This file is the main template for the homepage of your website.

Sample of standard file:

<?php
/* ########################################################################### *\
   ###  CATEGORY.TEMPLATE.PHP - 22/11/2007 - Copyright RedbeckGroup 2007   ###
\* ########################################################################## */
 
# Uses short description
# $Template->TemplateIndex->setShowShortDescription();
 $Template->Index->setUseProductFeatureFooter();
?>
 
<?php echo $Template->Index->getMainAdvert(); ?>
 
<!-- Category sub menu if set will display -->
<?php echo $Template->Index->getCategoriesSubMenu(); ?>
<div class="boxFeature_wrap">
    <?php echo $Template->Index->getProductMainFeatures(); ?>
  </div>
  <div style="width:100%; color: #fff">----------------------------------------------------------------------------------------------</div>
<div class="boxFeature_wrap">
    <?php echo $Template->Index->getProductFeatures(); ?>
  </div>
</div>
 
<?php echo $Template->Index->getProductFilterMenu(); ?>
 
<?php echo $Template->Index->getProductListings(); ?>

Category Data Calls

These calls are used specifically in the category.template.php file.

$Template->Index->getCategoriesSubMenu()

Returns the categories submenu (if there are any subcategories)

$Template->Index->getProductFilterMenu()

Returns the product filter menu for product listings. This is only displayed when there are no more sub categories to display.

$Template->Index->getProductListings()

Returns a tabular list of products, including all page number navigation and further product filters.

brand.template.php

File Sample

Sample of the brand.template.php file:

<?php
/* ########################################################################### *\
   ###     BRAND.TEMPLATE.PHP - 22/11/2007 - Copyright RedbeckGroup 2008   ###
\* ########################################################################## */
 
# $Template->TemplateIndex->setShowShortDescription();
 $Template->Index->setUseProductFeatureFooter();
?>
 
<?php echo $Template->Index->getMainAdvert(); ?>
<div style="background: #f4f4f4; padding-left: 14px; margin: 10px;">Amazing Offers at <?php echo $Template->Index->getStoreName(); ?> . . . .</div>
  <div class="boxFeature_wrap">
    <?php echo $Template->Index->getProductMainFeatures(); ?>
  </div>
  <div style="width:100%; color: #fff">----------------------------------------------------------------------------------------------</div>
<div style="background: #f4f4f4; padding-left: 14px; margin: 10px;">Other Products that may interest you . . . .</div>
  <div class="boxFeature_wrap">
    <?php echo $Template->Index->getProductFeatures(); ?>
  </div>
</div>
 
<?php echo $Template->Index->getProductFilterMenu(); ?>
 
<?php echo $Template->Index->getProductListings(); ?>

Generally, all the PHP calls you see in the brand template are used in the category template.

search.template.php

File Sample:

The search template is straight forwards, and follows a similar pattern to the other index template files.

<?php
/* ########################################################################### *\
   ###    SEARCH.TEMPLATE.PHP - 22/11/2007 - Copyright RedbeckGroup 2007  ###
\* ########################################################################## */
 
echo $Template->Index->getMainAdvert();
 
# filter to add here to filer search results
 
 echo $Template->Index->getProductFilterMenu();
 echo $Template->Index->getProductListings();
 
 
?>

 
Personal Tools