Tutorial
From Zen Cart(tm) Wiki
This tutorial explains how to make a very simple new sidebox.
Contents |
[edit]
Creating the new sidebox files
Note: replace new with the name of your new sidebox
A sidebox consists of three files which are located in the includes directory:
- modules/sideboxes/YOUR_TEMPLATE/new_sidebox.php
- languages/english/extra_definitions/YOUR_TEMPLATE/new_sidebox_defines.php
- templates/YOUR_TEMPLATE/sideboxes/tpl_new_sidebox.php
[edit]
includes/modules/sideboxes/YOUR_TEMPLATE/new_sidebox.php
<?php
$show_new_sidebox = true;
if ($show_new_sidebox == true){
require($template->get_template_dir('tpl_new_sidebox.php',DIR_WS_TEMPLATE,
$current_page_base,'sideboxes'). '/tpl_new_sidebox.php');
$title = BOX_HEADING_NEW_SIDEBOX;
$left_corner = false;
$right_corner = false;
$right_arrow = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE,
$current_page_base,'common') . '/' . $column_box_default);
}
?>
[edit]
includes/languages/english/extra_definitions/YOUR_TEMPLATE/new_sidebox_defines.php
<?php
define('BOX_HEADING_NEW_SIDEBOX', 'Gallery');
?>
[edit]
includes/templates/YOUR_TEMPLATE/sideboxes/tpl_new_sidebox.php
<?php $content = <<< End_Of_Quote Enter your sidebox content here End_Of_Quote; ?>
[edit]
Installing your new sidebox
- Upload these three files
- Go to admin/tools/layout box controller
If your installation was successfull this page will have a notice on the top that there is a new sidebox installed. Turn your box on and set it up to display where you want.
--Digitalusmedia 15:11, 8 November 2006 (EST)
Thanks to MommaMuse for the Blank Sidebox Mod that I am basing this tutorial on!
