Instant Cart Template Guide:

Main Template File

Welcome to the InstantCart template guide. Here you will find an overview of all the user specific functions available for use in your custom template.

Main Page Components

Main components help layout the template, adding key bits of information to the page such as meta tags, titles, banners and javascript.

$Template->getPageUrl()

This displays the page url, and base ref. Very important and must be used.

<?php echo $Template->getPageUrl(); ?>

Example of use:

<base href="<?php echo $Template->getPageUrl(); ?>" />

$Template->getPageTitle()

This displays the page title

Example of use:

<title><?php echo $Template->getPageTitle(); ?></title>

$Template->getMetaKeywords()

This displays the page defined meta keywords

Example of use:

<meta name="keywords" content="<?php echo $Template->getMetaKeywords(); ?>" />

$Template->getMetaDescription()

This displays the page defined meta description

Example of use:

<meta name="description" content="<?php echo $Template->getMetaDescription(); ?>" />

$Template->getJavascriptFilenames()

This displays the javascript filenames for the page

Example of use:

<?php echo $Template->getJavascriptFilenames(); ?>" />

$Template->getJavascriptCode()

This displays the JavaScript code block for the page Example of use:

<?php echo $Template->getJavascriptCode(); ?>" />

$Template->getAccountMenuItem()

This displays the login / register link, and alternates to My Account when a user is logged in. Example of use:

<?php echo $Template->getAccountMenuItem(); ?>

$Template->getBannersLeft()

This displays the banners you have set for the left column.

Example of use:

<?php echo $Template->getBannersLeft(); ?>

$Template->getBannersRight()

This displays the banners you have set for the right column. Example of use:

<?php echo $Template->getBannersRight(); ?>

Boxes

Set of functions that allow you to predefined and automated components to build up your website. Examples of boxes include the mini shopping basket, latest products, more pages, product menus etc etc. The first example in this instance can be used to html wrap most of the functions listed here.

$Template->getProductMenuBox()

This calls the left product menu. Example of use:

<div id="side_nav">
<div class="side_nav_title">Browse Products</div>
<?php echo $Template->getProductMenuBox(); ?>
</div>
<br />

$Template->getBasketBox()

This calls the mini shopping basket. You can customize the css style sheet that corresponds to this function. Any css definition starting with mini_ is used to stylize this box. Implementing your own style sheet over the default css style sheet is easily done by editing the template html css reference.

Example of use:

<div class="box_heading">
<div class="box_title">Your basket</div>
<?php echo $Template->getBasketBox(); ?>
</div>
<br />

$Template->getLoginBox()

This fetches the login box.

Example of use:

<div class="box_heading">
<div class="box_title">Login</div>
<?php echo $Template->getLoginBox(); ?>
</div>
<br />

$Template->getRecentBox()

This fetches the recently viewed products box. Usage is the same as the above functions.

$Template->getLatestProductsBox()

Displays the latest products, usage is the same as the above functions.

$Template->getNewsBox()

Displays News Content, usage is the same as the above functions.

$Template->getContentBox()

Displays website content links, usage is the same as the above functions.

$Template->getHelpBox()

Displays the preset help banner. Usage is in its own right:

<?php echo $Template->getHelpBox(); ?>

$Template->getSSLBox()

Displays the preset SSL Site seal if defined. Usage is in its own right:

<?php echo $Template->getSSLBox(); ?>

Default Template URLs

Set of functions that allow you to call the default template server url to load default images, css and javascript code. Please see file url reference base for a list of available scripts and images you can use throughout your website.

$Template->getTemplateServerUrl()

This fetches the specific server url and directory for the template used. This only applies to a default template. Its unlikely you will use this as it is auto called throughout the site.

$Template->getTemplateImagesUrl()

This fetches the specific image set directory for the template used. This only applies to a default template. It means you can reference images in your template in the format of:

<img src="<?php echo $Template>getTemplateImagesUrl().'logo.jpg'; ?>" />
$Template->getTemplateCssUrl()

This fetches the CSS Style sheet directory for the template used. The default filename will be in the format of style.css, so you would print the following in the template as:

<link rel="stylesheet" type="text/css" href="<?php echo $Template>getTemplateCssUrl().'style.css'; ?>" />

$Template->getTemplateCodeUrl()

This fetches the specific code directory for the template used. Javascript from the default directoy can be loaded by using the following: -

$Template->addJavascriptFilename($filename)<code>
In full:
<code php>$javascript_file = $Template->getTemplateCodeUrl().‘code/lib/prototype.js’ ;
$Template->addJavascriptFilename($javascript_file)

The above code would be inserted within the header, before any html is parsed. If you want to load a javascript file from your own server location, simple type the relative or server url of the script, for example:

$javascript_file = ‘code/lib/prototype.js’ ;

 
Personal Tools