1
kevinv
Fetching all submenus in main menu
  • 2006/6/3 19:14

  • kevinv

  • Friend of XOOPS

  • Posts: 44

  • Since: 2003/1/4 1


I'm trying to modify the main menu block to show ALL sub-menu items, not just the ones in the current module.

The main menu block uses the following to build the menu:

<!-- start module menu loop -->
<{foreach item=module from=$block.modules}>
<a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a>
<{foreach item=sublink from=$module.sublinks}>
<a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
<{/foreach}>
<{/foreach}>
<!-- end module menu loop -->


Apparently $module.sublinks is only filled out for the current module. Are the other sub-menus available in a different smarty variable, or does this require a code change?

2
kevinv
Re: Fetching all submenus in main menu
  • 2006/6/3 19:36

  • kevinv

  • Friend of XOOPS

  • Posts: 44

  • Since: 2003/1/4 1


I solved this by modifying the code. Not sure if it's the only solution.

Find the system_blocks.php then find the line:
if ((count($sublinks) > 0) && (!empty($xoopsModule)) && ($i == $xoopsModule->getVar('mid'))) {


and change it to:
if ((count($sublinks) > 0) && (!empty($xoopsModule))) {

Login

Who's Online

173 user(s) are online (113 user(s) are browsing Support Forums)


Members: 0


Guests: 173


more...

Donat-O-Meter

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

Latest GitHub Commits