New Zenner
- Join Date:
- Jul 2006
- Posts:
- 60
- Plugin Contributions:
- 0
How To Create Your Own sidebox in v1.3.x
A sidebox consists of three files, which are located in the includes directory:
- modules/sideboxes/custom/name_of_sidebox.php
- languages/english/extra_definitions/custom/
name_of_sidebox_defines.php - templates/custom/sideboxes/tpl_name_of_sidebox.php
You need to replace custom and name_of_sidebox with your template name and the sidebox name respectively.
For example, let us build a sidebox named my_sidebox. Then, my_sidebox.php file will read like this:
<?php $show_my_sidebox = true; if ($show_my_sidebox == true){ require($template->get_template_dir('tpl_my_sidebox.php', DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_my_sidebox.php'); $title = BOX_HEADING_MY_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); } ?>
This page actually defines what is to be shown in that sidebox. Note that this page also includes the corresponding template file. Here, we have used a constant BOX_HEADING_MY_SIDEBOX.
You need to define this in the includes/languages/english/extra_definitions/custom/my_sidebox_defines.php file. This file will look like this:
<?php define('BOX_HEADING_MY_SIDEBOX', 'My Sidebox'); ?>
Now, you have to build its template file includes/templates/custom/sideboxes/tpl_my_sidebox.php
which will read as:
<?php $content = "This is my first Sidebox. I have created it in 5 minutes. Although it is not of practical use yet, I hope I can eventually build a good sidebox."; ?>
NOTE: Remember to replace custom with your over rides template name. And Remember to place them in the right folder paths. PLease comment if this helped you. I will post more on other features later.