2012/10/30 22:03:52
|
---|
|
block engine with IPFHello,
I added the block engine within my theme to load block_id's, but the code is not full IPF compatible. How should I use the icms_core_BlockHandler in this example? <?php
$icms_block_handler = xoops_gethandler('block');
$xobject = $icms_block_handler->get($block_id, TRUE);
$template = new icms_view_Tpl();
$block = array(
'id' => $xobject->getVar( 'bid' ),
'module' => $xobject->getVar( 'dirname' ),
'title' => $xobject->getVar( 'title' ),
'weight' => $xobject->getVar( 'weight' ),
'lastmod' => $xobject->getVar( 'last_modified' ),
);
$tplName = ( $tplName = $xobject->getVar('template') ) ? "db:$tplName" : "db:system_block_dummy.html";
if ( $bresult = $xobject->buildBlock() ) {
$template->assign( 'block', $bresult );
$block['content'] = $template->fetch($tplName);
} else {
$block = FALSE;
}
$this->assign('block', $block);
?> |
2012/10/31 7:45:23
|
---|
|
Re: block engine with IPFIt would be much easier having a full example of your code and not those snipptet with some unknown variables..
![]() Well, calling the blocks you might have different ways. Think, it should be ok just calling the default way.
$block_handler = icms::handler('icms_view_block');
$blockObj = $block_handler->get($block_id);
|
2012/10/31 18:33:00
|
---|
|
Re: block engine with IPFGreat, this works as well. No errors right now
![]() |