Originally Posted by
shags38
I am trying to utilize these middle boxes on other pages. I currently use one box on the main page in location 3, Below New, Specials, Featured etc. centerboxes.
In admin/configuration I changed to 0 for ALL pages and then selected location 9 for a box (Categories - Always Show on Main Page is set to No) and entered some text in that box in define pages editor but I am not seeing that box show up on any pages which I expected it should - have I missed something? from the configuration instructions in readme ... If you use the position settings 8 or 9 for a box, it will appear on all pages regardless of other settings. (all pages I believe only includes home and category pages?) ... I'm not seeing any error logs.
cheers, Mike
P.S. I found this in the readme however I am not sure that it applies to the above, albeit would it be relevant if I wanted to include a box in an EZ page?;
HTML Code:
If you want to add new locations where middleboxes can be displayed, you will need to insert a
get_template_dir('tpl_middleboxes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_middleboxes.php'); ?>
statement in the desired location, with the new location number (8 or higher) in place of the X and the comment text you want to use to identify the middlebox group in the page's HTML source.
Then you will need to modify the SQL to update the middlebox location settings in the admin menu, adding the new locations, and run the SQL in Tools > Install SQL Patches.
Alternatively, you can simply move one of the existing
get_template_dir('tpl_middleboxes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_middleboxes.php'); ?>
function statements from a location you do not need to a new location or file where you want to use it. This requires no SQL modifications, though the admin setting descriptions will not describe your new location.
To identify an included middle box to a given "number", if you notice in the other examples the pattern:
Code:
<?php
$box_loc = '1';//middlebox group
require($template->get_template_dir('tpl_middleboxes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_middleboxes.php');
?>
<?php
$box_loc = '2';//middlebox group
require($template->get_template_dir('tpl_middleboxes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_middleboxes.php');
?>
<?php
$box_loc = '3';//middlebox group
require($template->get_template_dir('tpl_middleboxes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_middleboxes.php');
?>
Each of the $box_loc variables relates back to MIDDLEBOX_NUMBER_1, MIDDLEBOX_NUMBER_2, and MIDDLEBOX_NUMBER_3 respectively.
Boxes 8 and 9 are not currently in the template files and must be added where desired. To identify a box to be of group 8 or 9 (or above if additional have been added), need to include the below where it is desired to display the content associated with the box:
Code:
<?php
$box_loc = '8';//middlebox group
require($template->get_template_dir('tpl_middleboxes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_middleboxes.php');
?>
And wherever that particular group has been added for display it will be displayed. The incorporation points provided in the existing template files are basically examples or starting points to see operation. Like all things ZC their placement location can be modified to suit. Just remember if $box_loc >= 8, then it will be displayed whether the current page is the homepage or not.
Bookmarks