1
rh94040
Best way to add additional menu items
  • 2004/4/18 21:04

  • rh94040

  • Just popping in

  • Posts: 51

  • Since: 2004/4/13


Xoops 2.0.6

In general, is it better to add additional menu items
under the Main Menu or through a custom block (a new Menu)?
In my case, I have a need to restrict access to my
menu items depending on user's group membership. If a
user is not in a group that should view the page
corresponding to the menu item, I don't want that menu
item to display in the menu, AND I don't want the
corresponding page to display even if the user enters the
URL explicitly.

If done through the Main Menu, is coding required?
I couldn't figure out how to do it thru configuration
via the Web admin tool.

If through a custom block, how do I achieve displaying
menu items based on user's membership (and really restrict
access)?

Thanks much,
Ray

2
rh94040
Re: Best way to add additional menu items
  • 2004/4/18 21:11

  • rh94040

  • Just popping in

  • Posts: 51

  • Since: 2004/4/13


One additional question, how do I achieve layered menu items,
e.g.:

Main Menu:
my menu item 1
-->child 1
-->child 2
------>child a of child 2
------>child b of child 2
-->child 3
my menu item 2
standard menu item (Forum)
...


How do I do this in the Main Menu and through a custom block?

Thanks,
Ray

3
Fritz
Re: Best way to add additional menu items
  • 2004/5/19 18:27

  • Fritz

  • Just popping in

  • Posts: 47

  • Since: 2004/5/5 1


Ray,

My understanding is that you cannot add custom menu items to the Main Menu. See my post in the Feature Request forum.

You can use MultiMenu or iMenu to create custom menus, though neither allows for sub-or-child menus.

Due to these limitations, I am planning to create a set of custom blocks with my own combination of html and dhtml to create a navigational menu with custom menu items, where each variation of the block can be displayed in different areas of the site

4
talunceford
Re: Best way to add additional menu items

Another way that you can modify the main menu and not affect the way that it does its magic is by modifying the template for it in the XOOPS Admin->System Admin->Templates manager. This template should be under the systems module. This way it will show up the same way under every theme that you have available.

system_block_mainmenu.html is the template that you will need to edit. Just look at the code to match up the css styles and you should be fine. I had to do this to add in a couple custom links to the user block.

<table width="100%" cellspacing="0">
  <
tr>
    <
td id="mainmenu">
      <
class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}></a>
      <!-- 
start module menu loop -->
      <{foreach 
item=module from=$block.modules}>
      <
class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a>
        <{foreach 
item=sublink from=$module.sublinks}>
          <
class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
        <{/foreach}>
      <{/foreach}>
      <!-- 
end module menu loop -->
    </
td>
  </
tr>
</
table>



I supplied the original code for the main menu. Just add in your custom links after the last closing tag for the row.

<table width="100%" cellspacing="0">
  <
tr>
    <
td id="mainmenu">
      <
class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}></a>
      <!-- 
start module menu loop -->
      <{foreach 
item=module from=$block.modules}>
      <
class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a>
        <{foreach 
item=sublink from=$module.sublinks}>
          <
class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
        <{/foreach}>
      <{/foreach}>
      <!-- 
end module menu loop -->
    </
td>
  </
tr>
<
tr>
<
td>
<
a href="<{$xoops_url}>/customlinklocation">custom link</a>
</
td>
</
tr>
</
table>


If you do that you should be good to go with custom links in your main menu.

5
Fritz
Re: Best way to add additional menu items
  • 2004/5/19 22:37

  • Fritz

  • Just popping in

  • Posts: 47

  • Since: 2004/5/5 1


The only down side to this hack is that your custom links either have to be before or after the dynamic links in the menu.

Login

Who's Online

175 user(s) are online (106 user(s) are browsing Support Forums)


Members: 0


Guests: 175


more...

Donat-O-Meter

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

Latest GitHub Commits