Methods → SetWidgetAreas
Similar to WP’s register_sidebar, registers widget areas (or sidebars) for the current theme. It can also preset default widgets, and as well as configure them.
Description
void Atom::app()->setWidgetAreas($array [, $array2, ...]);
Example
Atom::app()->setWidgetAreas(
// 1st
array(
'name' => _a('My Sidebar'),
'id' => 'my_sidebar',
'description' => _a('Sidebar description goes here'),
'before_widget' => '<li class="block"><div class="block-content block-%2$s clear-block" id="instance-%1$s">',
'after_widget' => '</div></li>',
'before_title' => '<h3 class="title">',
'after_title' => '</h3>',
'default_widgets' => array('atom-search', 'atom-tabs', 'atom-login', 'atom-links')
),
// 2nd
array(
'name' => _a('Another Sidebar'),
'id' => 'another_sidebar',
'description' => _a('Sidebar description goes here'),
'before_widget' => '<li class="block"><div class="block-content block-%2$s clear-block" id="instance-%1$s">',
'after_widget' => '</div></li>',
'before_title' => '<h3 class="title">',
'after_title' => '</h3>',
'default_widgets' => array('atom-tag-cloud', 'atom-users')
)
// and so on...
);
To configure the default widgets pass a associative array with the widget configuration, instead of a string:
'atom-tag-cloud' => array(
'title' => _a('Tags from my site'),
'gradient_start' => '666666',
'gradient_end' => 'eeeeee'
),
Last revision 14 years