Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Hide menu from logged users - not working

Hide menu from logged users - not working

In short I just need to hide a particular menu when user logs in. A very simple task including one module ID. which I put into "Quick module id include" field and set "Show quick module(s) to" to "Not logged in users only". Somehow it doesn't work for me. I tried different variations, checked your recipes page - no reaction at all. Looks like module simply not working.

I have Joomla 1.5.14 and here's a debug info I got:

*********************************************

MetaMod debug info:

Warning: htmlentities() expects parameter 1 to be string, array given in /home6/netvitil/public_html/newsite/modules/mod_metamod/helper.php on line 186
$option:
$view: frontpage
$id:
$Itemid: 60
$timezone: default
$language: en
$language_code: en
$language_region:
Logged-in users only; no logged-in user found.

*********************************************

Any help is appreciated. Thank you.

Monkeyman
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Hide menu from logged users - not working

Hi Monkeyman,

thanks for the debug output, that's informative.

It's weird that you're getting the error that you're getting. What this means is that "$option" (the equivalent of "option=..." in the URL) is getting messed around by some other component on your system. It's supposed to be a string, but something has converted that to an array...

Actually that probably doesn't have a bearing on the problem you are experiencing though.

Can I suggest that you check a few things:

1 - the debug output above suggests that you are not logged in to the site, but that "Show Quick Module(s) to:" is set to "Logged-in users only". Right?

Therefore it's not surprising that the menu (module) is not appearing.

From what you described, this is the opposite of what you are wanting to happen. Try setting "Show Quick Module(s) to:" to "Non-Logged in users only".

2 - make sure that the module you are including is turned ON.

3 - make sure that the module you are including has "Menu Assignment" set to "none"

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Hide menu from logged users - not working

OK, that was my bad. I had it showing on all pages and after setting it to "None" worked like a charm.

Unfortunately it didn't satisfy my needs. All I needed is show/hide module, but instead MetaMod INCLUDES the module in it's own and just show/hide itself. So, for example, it can't be properly set to be used with complex menus like YooThemes have. I created a separate menu and set MetaMod position to "menu" - got totally messed up menu block.

Am I doing something wrong, or it's a whole idea - to include modules in MetaMod?

Monkeyman
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Hide menu from logged users - not working

I'm not quite sure what you are referring to when you way "it can't be properly used with complex menus...". Certainly there can be some challenges, but pretty much all of those can be solved with MetaMod Pro.

I *think* that your issue is probably about the extra HTML that gets generated by including other modules inside a MetaMod module. Menus like Yootheme menus, as long as they are included into the page as modules (rather than being hardcoded into the template), are very sensitive to changes in HTML, because of the way they use CSS rules. Adding an extra layer of HTML around the menu is quite likely to mess up the CSS. Normal modules (non-menu) are usually a bit more tolerant, though see the FAQs to find some ways around it:

http://www.metamodpro.com/support/faq/2 … etamod-was
http://www.metamodpro.com/support/faq/2 … th-matamod

So, if you are using MetaMod to swap the main menu in and out, I would recommend the use of MetaMod Pro to ensure that *no* extra HTML gets put around any modules that the MetaMod includes. That way, there will be absolutely no difference between the HTML produced when MetaMod includes a module, and when the module is inserted *without* MetaMod being involved - and if there's no difference in the HTML, then there's no difference in the working of the menu.

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Hide menu from logged users - not working

Thank you for explanation. The problem indeed is in very complex CSS of YooTheme. I'll explain you what I have now and what would like to have in general.

I've created a separate menu which should be visible only to NOT logged users. It includes items like "Login", "Register" of "Password reminder". I don't want to use standard login module, so I put stuff in menu. It looks like this:

Authorization
|-- Login
|-- Register
|-- Forgot your password?

Authorization is of Separator type. When it stays in menu, it works perfect and all items just slide down. After I put this in MetaMod, visually it looks like this:

MetaMod
|--Authorization
   |-- Login
   |-- Register
   |-- Forgot your password?

Menu drops down, but it doesn't work properly - all styles are messed up. I tried to put "-metamod" to module suffix, tried to force it to use corresponding YooTheme styles, but no go. Unless there's a placeholder it won't work, I guess.

I probably tried all possible variations in styling - nothing helped.

Monkeyman
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Hide menu from logged users - not working

Hi,

this is why we have MetaMod Pro - to solve this sort of problem! When CSS rules get this complex then I give up trying to manipulate them. It's a thankless task unless you're an absolute CSS genius.

Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Hide menu from logged users - not working

That's very nice, but I'd like to try MetaMod Pro first, THEN buy it. I'm not ready to buy something not being 101% sure it works for me and works good.

Any trial period for MetaMod Pro or something?

Monkeyman
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11577
Newest User:
owens65784
Members Online:
0
Guests Online:
192

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked