Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
Menu displayed for guests only
Menu displayed for guests only
Hi,
I am using Joomla 1.5.15 and MetaMod v2.2c. I have two Main menu modules and I want one to be displayed for guests only and the other one for logged in users. They have different menu items on them. I am using Fanboy template and Praisemenu (both from Pixelpraise). Both menus are assigned to user7 module position. Module id's are 16 (access level public) and 84 (access level registered). But I have no idea on how to get MetaMod to work, so that module id16 would dissapear for registered users.
Appreciate your help.
Thanks
Re: Menu displayed for guests only
Hi Mavex,
1 - edit both menu modules and unpublish them, so they don't show up on your page.
2 - create a MetaMod and put it into the user7 position, assigned to whichever menu items you want it to appear on (maybe "all").
3 - in the MetaMod, turn off the "title"
4 - in the MetaMod, don't put anything into the "Quick Module ID Include box", just put the following into the PHP box:
if (MM_LOGGED_IN) return 84;
else return 16;
Things to watch out for:
Unless you are using MetaMod Pro, you may have issues with the layout and styling of the menus not being exactly what you intended. This is because Metamod puts an extra layer of module HTML around the modules that it includes.
To get around this, try 2 things:
1 - try different values of the "style for included modules" dropdown in MetaMod, e.g. xhtml or raw.
2 - try giving the MetaMod a css class suffix. e.g. "-metamod". The idea here is that by changing the CSS class of the MetaMod, this can often cause CSS to ignore the outer MetaMod HTML, and just style the inner module that MetaMod included.
Hope this helps,
Stephen
Re: Menu displayed for guests only
For some reason I don't seem to be able to do this.
OK. So, let me be very precise here:
I have 2 menus:
[1] title = Main Menu, Type = mainmenu, #modules = 3, ID=1
[2] title = Main Menu Registered, Type = mainmenureg, #modules = 1, ID = 7
Now I have 2 modules of type mod_mainmenu, both in menu position, and pages = none
[1] title = Main Menu, enabled = false, ID = 1, menu name = mainmenu
[2] title = Main Menu Registered, enabled = false, ID = 78, menu name = mainmenureg
Finally I have a Metamod module:
[1] title = MetaMod Main, position = menu, enabled = false, ID = 79, show_title = NO
And in the PHP box
if (MM_LOGGED_IN) return 78;
else return 1;
What am I doing wrong?
Your comments are certainly very welcome!
Thanx,
Lolke
Re: Menu displayed for guests only
Last but not least, I use it with Yoothemes phoenix template. Having a submenu requires a module that is linked to the menu module, which should then be disabled. Looks like a module within a module as well? Not sure. Compatibility problem?
And of course, you're out of office. I just got it.
http://www.abcimport.nl/
Re: Menu displayed for guests only
Hi Lolke,
Sorry it's taken a while to respond - I'm in the UK on business for 2 weeks and not able to give my usual level of support.
Based on your first post in this thread, the only thing that I could see wrong was that the MetaMod itself was disabled. You need to set the MetaMod to ENABLED, otherwise the code in the MetaMod won't get run, and the other modules are never going to get included.
Just to reiterate: keep your target modules DISABLED, and the MetaMod ENABLED. Then, the MetaMod will get "run", and it will include and enable the other modules depending on the rule that you put in.
With regard to your later posts: I didn't understand you 100%. But if you go back to the beginning and enable the MetaMod, you might just get it working.
Best regards,
Stephen
Re: Menu displayed for guests only
Hi Stephen,
It's the first thing I did of course, but then it does show Metamod Main in the menu (containing the other module) regardless of the title setting (disabled). So, I tried disabling it but felt it couldn't work this way and it won't as you pointed out.
You can see the result of having it enabled here (2 screenshots showing metamod is active and embeds the right module depending on the LOGGED_IN status)
http://www.abcimport.nl/test/
But obviously not the result I was hoping for. Looks like compatibility issue? I'll try it with the default template as well.
Regards,
Lolke
Re: Menu displayed for guests only
Hi Lolke,
ok, that makes sense. I am pretty sure that what's happening now is due to the fact that MetaMod wraps the target module in a bit of HTML code. That's an integral part of module-within-a-module system, as Joomla will place some divs or table elements around each layer of module. This, plus the CSS code that is activated by the extra HTML, can play havoc with the layout of menus -- menus tend to be heavily dependent on exact CSS styling, particularly for dropdowns.
What does fix situations like this is MetaMod Pro. This gets rid of the extra HTML that is being added by the "wrapping" MetaMod, and just leaves the HTML of the target module. The final HTML is the same as if MetaMod was not involved, and the target module was just assigned in the completely normal way.
Hope that helps,
Stephen
Re: Menu displayed for guests only
One more thing to this Stephen,
I will be moving to Joomla 1.6 as soon as it's available and the template I am using has been ported. Will Metamod still work then, or won't it be needed?
And:
If I decide buying it now, will you guarantee it will work with the template I am using? (it says never needs changes to templates). I am certainly spending that 20 $ if you're guaranteeing it will work.
Thanks for your support.
Lolke
Board Info
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked