[TYPO3-commerce] Building navigation menu using itemArrayProcFunc

Jeroen Visser jeroen at roquin.nl
Mon Nov 5 09:46:58 CET 2007


Hi Franz,
After some code changing The result that the menu Items are without a 
category title.

The TS (as you suggested):
lib.topmenu.2 = TMENU
lib.topmenu.2 {
   itemArrayProcFunc = user_menu
   itemArrayProcFunc {
     userFunc = user_tx_commerce_catmenu_pub->init
     category = {$plugin.tx_commerce_lib.catUid}
     showProucts = 0
     overridePid = {$plugin.tx_commerce_lib.overridePid}
     useRootlineInformationToUrl = 
{$plugin.tx_commerce_lib.useRootlineInformationToUrl}
   }

   wrap = <ul class="level2">|</ul></li>
   NO {
     allWrap = <li>|</li>
   }
}

The PHP:
function user_menu($menuArr,$conf){
   //Only for commerce categories
   if($menuArr[0]['pid']==404){
     $indexerObj = &t3lib_div::makeInstance('tx_commerce_navigation');
     $menuArr = $indexerObj->init('',$conf);
   }
   return $menuArr;
}

I do get my six rows (There are six categories) in my list only without 
category titles. Have you got any idea?

Regards,
Jeroen

Franz Koch wrote:
> Hi,
> 
>> Maybe someone could help me out here. I am building a category 
>> dropdownmenu for commerce.  When I return the array from the function 
>> I get errors like: "Error in the typoScript configuration"
> 
>>     $conf['special.userFunc']='user_tx_commerce_catmenu_pub->init';
> 
> using 'special.userFunc' as array key won't work. You have to add the 
> definition of the userfunc to the array you apply to 'special.' - like:
> ----
> $conf['special.'] = array(
>     'userFunc' => 'user_tx_commerce_catmenu_pub->init',
>     'category'=>'{$plugin.tx_commerce_lib.catUid}',
>     'showProducts' => 0,
>     'overridePid' => '{$plugin.tx_commerce_lib.overridePid}',
>     'displayManuForCat' => '<',
>     'useRootlineInformationToUrl' => 
> '{$plugin.tx_commerce_lib.useRootlineInformationToUrl}',
>     '1'=>'TMENU','2'=>'TMENU','3'=>'TMENU'
> );
> ----
> 
> but why do you define all this stuff in php and not in your TS? And I'm 
> really not sure if you can work with constants from inside php - I guess 
> there is your main problem. Try setting this in TS:
> 
> ----
> lib.topmenu.2 {
>   itemArrayProcFunc = user_menu
>   itemArrayProcFunc {
>     userFunc = user_tx_commerce_catmenu_pub->init
>     category = {$plugin.tx_commerce_lib.catUid}
>     showProucts = 0
>     overridePid = {$plugin.tx_commerce_lib.overridePid}
>     useRootlineInformationToUrl = 
> {$plugin.tx_commerce_lib.useRootlineInformationToUrl}
>   }
> }
> ----
> 
> Anyway - I don't get it why you are using your own itemArrayProcFunc to 
> just call another itemArrayProcFunc from within your php. But I don't 
> have to understand everything :)
> 
> -- 
> Greetings,
> Franz
> 



More information about the TYPO3-project-commerce mailing list