1
cazabra
custom menu per module
  • 2005/8/24 4:23

  • cazabra

  • Just popping in

  • Posts: 3

  • Since: 2005/8/24


I have played with this for more hours than I care to admit .. and can't figure out how to display a different menu based on the module being displayed.

Images per module are easy as I just have
img src="images/someimage.jpg" in my theme.html and then put whatever version of someimage.jpg in each module directory.

I was hoping to do the same with the mainmenu but can't get the module directory to be recognized with any variables I've tried.

Here is an example of something I thought might work to demonstrate what I mean ...

editing either theme.html or system_block_mainmenu.html

replacing the current foreach item=module block with something like this ..

include file="<{$xoops_url}>/modules/<{$module.directory}>/main_nav.inc"

.. such that if I were browsing the Real Estate module, modules/realty/main_nav.inc would display
.. and when browsing the piCal module
modules/piCal/main_nav.inc would display


Obviously smarty is not my forte so I apologize if this is an easy thing to do and will be forever grateful to anyone with suggestions.

BTW.. I have installed multimenu and it doesn't do what I want or I'm not smart enough to figure it out


TIA
-wendy

2
mboyden
Re: custom menu per module
  • 2005/8/24 4:32

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


There are a couple of ways to tackle this, but either way, you need to make individual menus for each one to get the type of distinctly different menus you seem to be looking for. These will have to be manually changed as you add modules and the likes, but unless you do major re-programming, you won't do it through smarty templates.

Using either MultiMenu or Custom Blocks, make the individual menu blocks you want for each module (you may have to steal code for custom blocks -- MultiMenu will likely be easier). Then display only that block in each module (using the Groups and Blocks area of the system module to set permissions and viewing).

With what I think you've described, you can't do it with a single block.

Let me know if this isn't understandable.
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

3
cazabra
Re: custom menu per module
  • 2005/8/24 13:32

  • cazabra

  • Just popping in

  • Posts: 3

  • Since: 2005/8/24


thanks a ton for your insight !

xoops is new to me so I hadn't played with blocks/groups sufficiently to realize they could be assigned to modules like that

I'll post the results asap.

-wendy

4
cazabra
Re: custom menu per module
  • 2005/8/27 22:27

  • cazabra

  • Just popping in

  • Posts: 3

  • Since: 2005/8/24


mboyden .... thanks SO much for your tip
It worked better than I could have hoped :)

Login

Who's Online

466 user(s) are online (56 user(s) are browsing Support Forums)


Members: 0


Guests: 466


more...

Donat-O-Meter

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

Latest GitHub Commits