Difference between revisions of "Making a Custom Sidebox"

From Zen Cart(tm) Wiki
Jump to: navigation, search
Line 1: Line 1:
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:
 
#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
 
 
====includes/modules/sideboxes/YOUR_TEMPLATE/new_sidebox.php====
 
 
<?php
 
  $show_new_sidebox = true;
 
  if ($show_new_sidebox == true){
 
    require($template-&gt;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-&gt;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===
 
#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.
 
 
 
--[[User:Digitalusmedia|Digitalusmedia]] 15:11, 8 November 2006 (EST)
 
 
''Thanks to MommaMuse for the Blank Sidebox Mod that I am basing this tutorial on!''
 

Revision as of 00:35, 5 December 2007