1
Hi,
I tri to use a block with temple so i have configured the xoops_version like that
$modversion['blocks'][2]['file'] = 'menu_blocks.php';
$modversion['blocks'][2]['name'] = _MI_VETEXPERT_MENU_BLOCK;
$modversion['blocks'][2]['description'] = _MI_VETEXPERT_MENU_BLOCK;
$modversion['blocks'][2]['show_func'] = 'vetexpert_menu';
$modversion['blocks'][2]['template'] = 'vetexpert_menu.html';
$modversion['blocks'][2]['isactive'] = 1;
$modversion['blocks'][2]['visible'] = 1;
Coding my block function
function vetexpert_menu() {
$block = array();
$block['title'] = _BL_VTX_TITRE_MENU;
$menu = array();
$menu['title']=_BL_VTX_GEN_CLIENT;
$menu['url']='/modules/vetexpert/index_vxp_client.php';
$block['mainmenu']=array();
$block['mainmenu'][1] = $menu;
$menu['title']=_BL_VTX_GEN_RACE;
$menu['url']='/modules/vetexpert/index_vxp_race.php';
$block['mainmenu'][2] = $menu;
$menu['title']=_BL_VTX_GEN_ESPECE;
$menu['url']='/modules/vetexpert/index_vxp_espece.php';
$block['mainmenu'][3] = $menu;
$block['content'] = 'toto';
return $block;
}
And my template
<table class="even">
<{foreach item=menu from=$block.mainmenu}>
<tr <{cycle values="even,odd"}> >
<td align="center" valign="top"><a ref="<{$menu.url}>"><{$menu.title}>a>td>
tr>
<{/foreach}>
table>
When i debug with "debug smarty template console" my block variable have only 2 ocuurs : title and content i don't see my mainmenu occurs.
{$block} Array (2)
title => Client
content =>
And my block (my template) is empty,
Where is my mistake ? Is someone can help me ? I need you
Best regards