Hi ircsurfer,
Your question is much better and clearer. I really appreciated the example you created which helped me reproduce the problem and come up with a solution which will hopefully meets your requirements.
The most obvious problem has to do with the number of parameters you specified. No worries, I have made this mistake myself on several occasions and it has often sent me troubleshooting for hours. Now it's always the first thing I check when things don't seem to be working as expected.
Start by merging your fourth and fifth parameters. According to the documentation:
show_menu2(
$aMenu = 0,
$aStart = SM2_ROOT,
$aMaxLevel = SM2_CURR+1,
$aOptions = SM2_TRIM, <-- SEPARATE OPTIONS HERE USING A | CHARACTER
$aItemOpen = '[li][a][menu_title]</a>',
$aItemClose = '</li>',
$aMenuOpen = '[ul]',
$aMenuClose = '</ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false
)
For $aOptions, specifying this parameter is optional however if you are going to use it, you must specify exactly one option from GROUP 1 and any number of options from GROUP 2, separating them by a pipe (|), not a commas (,). For more information on the available options in each group, see the documentation.
To avoid ending up with unrelated branches expanding at the same level as in your example, replace the SM2_ALL with the SM2_TRIM option.
TIP: For the purpose of troubleshooting, I highly recommend you also apply the SM2_PRETTY option which will nicely format your HTML and make it easier for you to understand what is going on when you make a change
Give this line a try:
show_menu2(2, SM2_ROOT, SM2_CURR+1, SM2_TRIM|SM2_PRETTY);
Hope this helps!
With warmest regards,
Michael Milette
___________________ ________
TNG Consulting Inc.
Provinding Sustainable Solutions for Life
www.tngconsulting.c a