I can’t seem to find an example on parameters. I can “hard code” them but can’t seem to dynamically generate them based on data in an array. Perhaps just poor coding on my part! Probably so. Here’s my code.
sc_appmenu_reset(‘kb_tree’);
sc_appmenu_create(‘kb_tree’);
sc_appmenu_add_item(‘kb_tree’,‘home’, ,‘Home’, , , , , );
sc_appmenu_add_item(‘kb_tree’,‘search’, ,‘Search’,‘article_grid’, , , , );
sc_appmenu_add_item(‘kb_tree’,‘faq’, ,‘FAQs’,‘article_grid_view’,‘locale=3’, , , ); //hardcoded
sc_appmenu_add_item(‘kb_tree’,‘faq2’, ,‘FAQ2’,‘article_grid_view’,‘locale=1’, , , ); //hardcoded
sc_lookup(dsmenu,"
select
taxonomy_id,
parent,
description
from
article_taxonomy
order by
parent,
node_order");
foreach ({dsmenu} as $arr_menu) {
$id_item = ‘item_’.$arr_menu[0];
if($arr_menu[1] == 0){
$id_parent = '';
}else{
$id_parent = 'item_'.$arr_menu[1];
}
$description = $arr_menu[2];
$params = ‘locale=’.$arr_menu[0];
sc_appmenu_add_item(‘kb_tree’,$id_item,$id_parent,$description,‘article_grid_view’,$params, , , );
}
It is dying at the $params insertion into the sc_appmenu_add_item that is dynamically built. Notice the FAQ at the top. These work properly. So, I can’t see what’s wrong. Any suggestions would be great.
-Tim