HOME TIPS FORUMS DOWNLOADS
   »»  Tips Archive |
Tricks/Tools : Custom Menu Block
Posted by tl001 on 2004/7/28 11:20:00 (12550 reads)
Tricks/Tools

There are several menu modules that let you customize the look of your Main Menu. But the ultimate control of the look is your very own custom block. And it is fairly easy to do.



An Example of a Main Menu with News, Forum, Web Links and Downloads.

Create a HTML block

<table cellspacing="0">
 <tr>
  <td id="mainmenu">
  <a class="menuTop" href="{X_SITEURL}">Home</a>
  <a class="menuMain" href="{X_SITEURL}modules/news/">News</a>
  <a class="menuSub" href="{X_SITEURL}modules/news/submit.php">Submit News</a>
  <a class="menuSub" href="{X_SITEURL}modules/news/archive.php">Archive</a>
  <a class="menuMain" href="{X_SITEURL}modules/newbb/">Forum</a>
  <a class="menuMain" href="{X_SITEURL}modules/mylinks/">Web Links</a>
  <a class="menuMain" href="{X_SITEURL}modules/mydownloads/">Downloads</a>
  </td>
 </tr>
</table>


When it's done and to your satisfaction, go to Groups and enable it for anonymous users.

Printer Friendly Page Send this Story to a Friend
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread
Anonymous
Posted: 2004/9/4 4:00  Updated: 2004/9/4 4:00
 Re: Custom Menu Block
There's an other solution, use the Multimenu module
sato-san
Posted: 2005/11/23 16:52  Updated: 2005/11/23 16:52
Just popping in
Joined: 2005/11/23
From:
Posts: 1
 Re: Custom Menu Block
FALSE:

Quote:


<table cellspacing="0">
<tr>
<td id="mainmenu">
<a class="menuTop" href="{X_SITEURL}"><Home</a>
<a class="menuMain" href="{X_SITEURL}">modules/news/">News</a>
<a class="menuSub" href="{X_SITEURL}modules/news/submit.php">Submit News</a>
<a class="menuSub" href="{X_SITEURL}modules/news/archive.php">Archive</a>
<a class="menuMain" href="{X_SITEURL}modules/newbb/">Forum</a>
<a class="menuMain" href="{X_SITEURL}modules/mylinks/">Web Links</a>
<a class="menuMain" href="{X_SITEURL}modules/mydownloads/">Downloads</a>
</td>
</tr>
</table>




TRUE:


Quote:


<table cellspacing="0">
<tr>
<td id="mainmenu">
<a class="menuTop" href="{X_SITEURL}/index.php">Home</a>
<a class="menuMain" href="{X_SITEURL}modules/news/">News</a>
<a class="menuSub" href="{X_SITEURL}modules/news/submit.php">Submit News</a>
<a class="menuSub" href="{X_SITEURL}modules/news/archive.php">Archive</a>
<a class="menuMain" href="{X_SITEURL}modules/newbb/">Forum</a>
<a class="menuMain" href="{X_SITEURL}modules/mylinks/">Web Links</a>
<a class="menuMain" href="{X_SITEURL}modules/mydownloads/">Downloads</a>
</td>
</tr>
</table>

tl001
Posted: 2005/11/23 17:44  Updated: 2005/11/23 17:52
Webmaster
Joined: 2004/6/10
From:
Posts: 282
 Re: Custom Menu Block
For those (me first )are wondering what is wrong here, there are typos in two URLs.
Quote:

<a class="menuTop" href="{X_SITEURL}"><Home</a>
<a class="menuMain" href="{X_SITEURL}">modules/news/">News</a>
<a class="menuMain" href="{X_SITEURL}">modules/news/">News</a>


The highlighted should not be part of the two URLs.

Thank you, sato-san.

[edit]As sato-san suggested, we have made corrections to the codes[/edit]
JMorris
Posted: 2005/11/25 10:55  Updated: 2005/11/25 11:04
Just popping in
Joined: 2005/7/10
From: Lost in thought
Posts: 12
 Re: Custom Menu Block
Another option is to clone your default template set and edit system_block_mainmenu.html. For instance, I wanted to create a sense of consistancy across all menus on my site, while enhancing accessiblity and improving SEO, here's what I did with system_block_mainmenu.html.

<ul>
  <li><a href="<{$xoops_url}>/" title="MyWebResource Homepage"><{$block.lang_home}></a></li>
  <!-- start module menu loop -->
<{foreach item=module from=$block.modules}>
  <li><a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/" title="<{$module.name}>"><{$module.name}></a> 
<{foreach item=sublink from=$module.sublinks}>
    <ul>
      <li><a href="<{$sublink.url}>" title="<{$sublink.name}>"><{$sublink.name}></a></li>
    </ul>
<{/foreach}> </li>
<{/foreach}>
  <!-- end module menu loop -->
  <li><a href="http://mywebresource.com/modules/liaise/index.php?form_id=1" title="Contact Us">Contact Us</a></li>
<{if $xoops_isuser}>
</ul>
<{else}>
<li><a href="http://mywebresource.com/user.php" title="Member Login">Member Login</a></li>
</ul>
<{/if}>


Best Regards,

James
macmend
Posted: 2006/3/5 17:29  Updated: 2006/3/5 17:30
Just popping in
Joined: 2005/8/21
From:
Posts: 17
 Re: Custom Menu Block
I took a look at multimenu its on steroids and so complicated it needs a manual. Got anything a bit simpler??