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.

 

Change name of module from login to logout

Change name of module from login to logout

Hi,

I'm using Joomla 1.7 and MetaMod 3-5 (free version).

I'm using metamod on a yootheme template. I have placed the login form module in the "menu" module position so that it appears that the menu contains a menu item called "Login". I created a clone of the Login form module and named it "Logout". I used metamod to switch the 2 modules using the following PHP code:

if (MM_LOGGED_IN) return 93; else return 83;

However, when i place the metamod module in the same module position as the 2 login forms, the menu item name appears as "MetaMod" because that is the name of the metamod module. So, instead of the menu saying "login" or "logout", it says "MetaMod" for both modules.

How can I use metamod to make the titles of the login and logout modules appear?

I have the metamod title turned off and the login and logout module titles turned on, but the metamod title still shows.

Edited By: cork
26-Aug-11 20:56:39

cork
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Change name of module from login to logout

Hi Cork,

I have a feeling that in this case, the YooTheme template is doing something kind of special with the "menu" module position. I think I have seen this before. It's not doing a normal "module position" instruction in the template, but going behind the scenes and grabbing information about the module out of the database.

In this case, MetaMod isn't going to work.

I have 2 other good alternatives:

1 - if your original (pre-MetaMod) module was a standard "mod_menu" module, then try replacing that with an Elastimenu module, available on this site. http://www.metamodpro.com/software/elastimenu

I don't know if this will work with the way that YooTheme is doing that main menu, but it might. The thing you can do with ElastiMenu (which is a drop-in replacement for mod_menu) is that you can select some of the menu items to only show when the user is a guest, and some that only show when the user is logged in. That way, your actual menu structure should contain menu items for guests AND logged-in users, but the ElastiMenu that displays them decides which ones to display at any given moment.

2 - Chameleon, also available on this site, can switch menu items on and off according to conditions. It's easy to make a condition that checks if the user is a guest. If the condition succeeds, then it can disable certain menu items. If it fails (i.e. the user is logged in) then it disables different menu items. This approach tends to work even when the ElastiMenu can't be used, e.g. if there's a completely different way of displaying the menu such as code in the template.

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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Change name of module from login to logout

Thank you Stephen. I'm not able to use Elasti Menu because I'm placing modules in the "menu" position. However, I'm on the verge of a solution.

Is there PHP code to hide the Metamod module after logging in?

Something like...

if ( MM_LOGGED_IN ) hide 47;

But this doesn't work.

cork
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Change name of module from login to logout

Hi Cork,

I have a feeling that this approach isn't going to work, sorry. The Yootheme template is doing something strange/interesting with the module position that's not a "normal" Joomla thing. It's somehow converting modules into menu items. This means that the normal MetaMod thing of including other modules inside itself just isn't going to work with it.

I'm going to send you a PM requesting more info. Stand by...

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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Change name of module from login to logout

Thank you, Stephen, I have replied to your email.

cork
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Change name of module from login to logout

Just for reference: I got this to work using MetaMod Pro.

The way that this works in the YooTheme Warp-based templates is that if you assign a module to the "menu" module position, the title of the module gets used as the name of a menu item, then the contents of the module is used as the drop-down from that menu item.

With standard MetaMod (non-Pro) this means that the name of the MetaMod itself is used as the menu item title, and there's nothing that you can do about it. It can't be turned off. The MetaMod can of course contain other modules, but that doesn't help the naming situation.

MetaMod Pro however DOES help. With Pro, the MetaMod itself disappears from the scene, and only the modules that the MetaMod includes get put into position (in this case the "menu" module position). They use all their own titles etc, just as if they were assigned to that position without the MetaMod being involved at all.

MetaMod Pro therefore is a good way to dynamically include/exclude modules being used as menu items in YooTheme Warp-based templates.


Cheers,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Change name of module from login to logout

Thank you, Stephen. Yes, that works perfectly! I'll buy MetaMod Pro, as I need it for the final project.

Great extension! Thanks again!

cork
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: Change name of module from login to logout

Glad it worked for you, thanks for reporting back.

Best regards,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Change name of module from login to logout

had the same problem

groove4x
Beginner Modder
ranks
useravatar
Offline
1 Posts
User info in posts
Administrator has disabled public posting

Re: Change name of module from login to logout

Hi groove4x,

If you'd like help with this, please provide more information. Also please read the rest of this thread to see if it's the same situation that you have - in which case you should be able to follow the same procedure to get it to work.

Best regards,
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
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4401
Newest User:
jason59312
Members Online:
0
Guests Online:
130

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