Making a Custom Sidebox

From Zen Cart(tm) Wiki
(Redirected from Tutorial)
Jump to: navigation, search

This tutorial explains how to make a very simple new sidebox.

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:

  1. modules/sideboxes/YOUR_TEMPLATE/new_sidebox.php
  2. languages/english/extra_definitions/YOUR_TEMPLATE/new_sidebox_defines.php
  3. templates/YOUR_TEMPLATE/sideboxes/tpl_new_sidebox.php

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);
 }
?>

includes/languages/english/extra_definitions/YOUR_TEMPLATE/new_sidebox_defines.php

<?php
  define('BOX_HEADING_NEW_SIDEBOX', 'Gallery');
?>

includes/templates/YOUR_TEMPLATE/sideboxes/tpl_new_sidebox.php

<?php
 $content = <<< End_Of_Quote
  Enter your sidebox content here
 End_Of_Quote;
?>

Installing your new sidebox

  1. Upload these three files
  2. 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!