1
ouioui
How Using template in a block
  • 2005/3/10 18:50

  • ouioui

  • Just popping in

  • Posts: 32

  • Since: 2003/7/11


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

2
JasonMR
Re: How Using template in a block
  • 2005/3/27 15:28

  • JasonMR

  • Just can't stay away

  • Posts: 655

  • Since: 2004/6/21


bump

Login

Who's Online

266 user(s) are online (165 user(s) are browsing Support Forums)


Members: 0


Guests: 266


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits