Tag Skin Container
This template tag adds a widget container to the skin. This container can later be filled with all sorts of Widget.
Example
<?php
// ------------------------- "Sidebar" CONTAINER EMBEDDED HERE --------------------------
// Display container contents:
skin_container( NT_('Sidebar'), array(
// The following (optional) params will be used as defaults for widgets included in this container:
// This will enclose each widget in a block:
'block_start' => '<div class="bSideItem $wi_class$">',
'block_end' => '</div>',
// This will enclose the title of each widget:
'block_title_start' => '<h3>',
'block_title_end' => '</h3>',
// If a widget displays a list, this will enclose that list:
'list_start' => '<ul>',
'list_end' => '</ul>',
// This will enclose each item in a list:
'item_start' => '<li>',
'item_end' => '</li>',
// This will enclose sub-lists in a list:
'group_start' => '<ul>',
'group_end' => '</ul>',
// This will enclose (foot)notes:
'notes_start' => '<div class="notes">',
'notes_end' => '</div>',
) );
// ----------------------------- END OF "Sidebar" CONTAINER -----------------------------
?>
Parameters
This template tag takes two parameters:
- The name of the container
- An array of extra parameters
Container name
You can basically use any container name you want and create as many containers as you wish. However, for common containers it is best to use the common names, such as NT_(’Header’) and NT_(’Sidebar’).
Note: NT_() is for translation to other languages. It doesn’t hurt to use it even if you don’t care about translation.
Using standard names will ensure that bloggers don’t lose their widgets + widget configurations when they switch from one skin to another.
For multiple sidebars, please use:
- NT_(’Sidebar’)
- NT_(’Sidebar 2′)
- NT_(’Sidebar 3′)
- etc.
Numbering of the sidebars should typically go from left to right, top to bottom.
The reason we don’t use names such as ‘left’ and ‘right’ is:
- it makes less sense on a 3 column setup
- it makes almost no sense at all on those skins with the "sidebar" being at the bottom or the top. It is still "side" content though (in a figurative way).
Extra parameters
These parameters will be passed down to the widgets at display time. They help insure that all widgets will display themselves by using a look & feel that is consistent with the current skin design.
(In technical terms, they help insure the XHTML markup the widgets will use matches the XHTML of the skin and that all this stuff validates in the end.)
Note that $wi_class$ will be replaced with a class name unique to each widget type. This allows you to do some specific CSS for some specific widgets. You should avoid this as much as possible though.
Doing specific CSS is a little bit like doing fixed width designs. It’s easier than fluid designs, but it’s a lot less flexible for the users.