Horizontal main menu - need smarty help
  • 2007/10/2 6:54

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


I have tried to integrate the main menu into my template as default horizontal menu.

i used the same code as that of mainmenu in default template set

<div style="float: right; width: 100%">
ul id="cssmenu">
li><a  href="<{$xoops_url}>/" id="menu1" title="<{$block.lang_home}>"><{$block.lang_home}></a></li>
item=module from=$block.modules}>
li class="havechild">  <a  href="<{$xoops_url}>/modules/<{$module.directory}>/" id="menu-<{$module.name}>"><{$module.name}></a>
item=sublink from=$module.sublinks}>
li >  <a  href="<{$sublink.url}>" id="menu-<{$sublink.name}>"><{$sublink.name}></a></li>


Things came up very nice, now i wanted to disable the the main menu from showing up in any blocks, so i marked the mainmenu block as disabled. This resulted in disabling my custom code of menu in theme too...:(

So i want to know how can i disable the main menu showing up in any of the blocks, yet it is should be active so that i can see its results in custom horizontal menu.

This is how it looks like now
Resized Image

Any help would be appreciated.


Re: Horizontal main menu - need smarty help
  • 2007/10/2 7:09

  • stefan88

  • Community Support Member

  • Posts: 1085

  • Since: 2004/9/20


one way would be to use the way from multimenu - read here: https://xoops.org/modules/newbb/viewto ... id=252742#forumpost252385

but instead of showing and hiding multimenu block, do it for mainmenu.

The other way may be to use a block position you don't need. For example if you do not use right blocks, remove the code for them from the theme and place the menu in that position ...


Re: Horizontal main menu - need smarty help
  • 2007/10/2 7:14

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


Very nice idea ! I hope you'll get some good help to make this block works !

Personnally I use for horizontal menu a morphogenesis gabarit (dynamic version) to make an horizontal main menu. It's not a block but maybe useful 'cause you can show or hide elements to visitors (relating to permissions)

[sorry for my poor english]

Still learning CSS and... english

Re: Horizontal main menu - need smarty help
  • 2007/10/2 8:49

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10

@stefan: Thanks, i got it fixed :)

@Burnning: thanks, I got my own horizontal menu using mootools javascript with some effects, finally it came up very well :) and simple, sobber drop down menu.

All i need to do is, include a menu theme file, in the main theme file and voila the horizontal menu appears up :)

Re: Horizontal main menu - need smarty help
  • 2007/10/2 8:51

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18

I see two "smarty" solutions on this.

· You have 8 possible locations for your block in XOOPS. Put the mainmenu block in a location that you don't use, then delete this location from the main template.

· Relocate one of those 8 possible locations to the position you want it to appear. This is how it's done in this site:


The submenu left is located bottom left column. I relocated it in the template.

More info on blocks location and rendering process here:

Another, more dirty trick should be to edit main menu template and add some CSS on the first tag:

style="visibility: hidden"

It's dirty, but it works.


Who's Online

79 user(s) are online (40 user(s) are browsing Support Forums)

Members: 1

Guests: 78




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

Latest GitHub Commits