justin's zen cart schtick

How to make a new sidebox

  1. first edit the english file at:

    includes/languages/mytemplate/english.php

    Add a line in it somewhere to define the sidebox title, like this: define('BOX_HEADING_MYSIDEBOX', 'My Sidebox Title');
  2. now create the main file:

    includes/modules/sideboxes/streetcat/mysidebox.php

    This one has all the program logic you want. You can also load all of the data up into variables for your template file to grab. At the end of it though, you need to have some variation of these six lines: require($template->get_template_dir('tpl_mysideboxphp',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_mysidebox.php'); $title = BOX_HEADING_MYSIDEBOX; $left_corner = false; $right_corner = false; $right_arrow = false; $title_link = false; require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
  3. finally create a template file:

    includes/templates/mytemplate/sideboxes/tpl_mysidebox.php

    Even though this file has the 'tpl' template abbrevivation built into it, it actually isn't a template, it's the content. You want to load all of your content into the $content variable. It'll normally look like a series of lines like this: $content = ""; $content .= "I'm inside my sidebox!";

lifefeed@gmail.com    »«    more zencart goodness    »«    home