[TYPO3-commerce] Building navigation menu using itemArrayProcFunc
Jeroen Visser
jeroen at roquin.nl
Mon Nov 5 09:15:29 CET 2007
Hello Franz,
The reason I tried it like this is because the commerce menu is added
inside my normal menu. For example the menu looks likes this:
HOME ABOUT US CATALOGUS CONTACT
submenu cat1 submenu
cat2 submenu
cat3
So when ($menuArr[0]['pid']==404) is true came at CATALOGUS and all the
cat1, cat2 and cat3 should be added to CATALOGUS. Otherwise the normal
procedure should take place to build the menu.
Filling the $conf array like you suggested at least got writ of the "No
category defined in TypoScript" error. But I still remain with "Error in
the typoScript configuration" which is displayed like the menu in the
end should look like:
I hope that this clarifies something about my reason to do it in this
way. Of course I'll be open for suggestions.
Thank's in advance.
Kind regards
Jeroen Visser
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