Backdrop CMS enables people to build highly customized websites, affordably, through collaboration and open source software.
Backdrop CMS enables people to build highly customized websites, affordably, through collaboration and open source software.
New structural site-building tool in Backdrop.
Super easy and familiar for themers
name = Fancy pants
type = layout
backdrop = 1.x
regions[header] = Header
regions[top] = Top
regions[content] = Content
regions[sidebar] = Sidebar
regions[footer] = Footer
Improved and more powerful!
function book_block_info() {
$blocks['navigation'] = array(
'info' => t('Book navigation'),
'description' => t('Shows the table of contents for a book.'),
);
return $blocks;
}
function book_block_info() {
$blocks['navigation'] = array(
'info' => t('Book navigation'),
'description' => t('Shows the table of contents for a book.'),
'required contexts' => array('node' => 'node'),
);
return $blocks;
}
function book_block_view($delta = '') {
$node = menu_get_object();
$block = array();
if ($node) {
$book_mode = variable_get('book_mode', 'all_pages');
$block['subject'] = t('Table of Contents');
$block['content'] = _book_toc($node, $book_mode);
}
}
return $block;
}
function book_block_view($delta = '', $settings, $contexts) {
$node = $contexts['node'];
$block = array();
if ($node) {
$book_mode = $settings['book_mode'];
$block['subject'] = t('Table of Contents');
$block['content'] = _book_toc($node, $book_mode);
}
}
return $block;
}
hook_block_configure()
, all forms within a single function.
function book_block_info() {
$blocks['navigation'] = array(
'info' => t('Book navigation'),
'description' => t('Shows the table of contents for a book.'),
'required contexts' => array('node' => 'node'),
'class' => 'BookNavigationBlock',
);
return $blocks;
}
class BookNavigationBlock extends Block {
function getTitle() {
return = t('Book navigation')
}
function getContent() {
return _book_toc($this->contexts['node'], $this->settings['book_mode']);
}
function form($form, &$form_state) {
return _book_configure_form($form, $form_state);
}
}
All block callbacks within a single class. No other hooks (hook_block_view(), hook_block_configure(), etc. are necessary.
IRC: #backdrop
http://backdropcms.org
github.com/backdrop
@backdropcms
Take this conversation online by tweeting using the hashtag #SrijanWW