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.

 

Login/Logout Module Display Not working?

Login/Logout Module Display Not working?

Hi,

I really like this module. I am working on a new Job website at the moment, just developing all the functionality. On the top right of the site in a module position called "top", I put a html_custom module called LOGIN. When a user clicks it and logs in, that same module position is replaced with a html_custom module called LOGOUT. Pretty simple right?

To do this, I put this in MetaMods:

if ( MM_NOT_LOGGED_IN ) { return 66; }
if (MM_LOGGED_IN) { return 44; }



I also had this, and various others I tried but all showed same results! Below:

if ($user->guest) ? 66 : 44;


BUT the problem I'm having is that when the user is logged in, the LOGIN module is still appearing, as its a "Public" access level module?? And it appears out of place too.

Website: www.facechatnow.com - I can PM an example login username/password to admin if you assist please.

Thanks!

umersaeed
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Login/Logout Module Display Not working?

Also, just want to mention that I have done a search through the forum for similar issues as mine, and found a couple which are sort of related, but theirs is Menu Item related. Mine is related to displaying/not displaying MODULES (CUSTOM_HTML ones) in terms of public or registered users.

The Menu Item thing works perfectly if I use MetaTemplate like you mentioned in other threads, but it just shows the menu as text and is out of place of my template. I chose to use custom modules as they contain a little Login image and Logout image too with the Text (as seen on my site right now).

If MetaTemplate had the SUCCEED and FAIL sections with MODULES as well as Menu Items, I will be CURED! ;-)

umersaeed
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Login/Logout Module Display Not working?

Hi Umersaeed,

this rule here should be perfect:

if ( MM_NOT_LOGGED_IN ) { return 66; }
if ( MM_LOGGED_IN ) { return 44; }

Now the most important thing is to ensure that the target modules (44 and 66) don't show up unless the MetaMod includes them.

To do this, follow instructions on the Quick Start guide:  http://www.metamodpro.com/metamod/quick-start

(basically, just set them to "none" module positions, or to a module position that does not appear on the page).

If the styling of the target modules is not what you expected, then experiment with different values of the "style for included modules" dropdown, and/or try setting a value for the "CSS class suffix" in the MetaMod. If you can't get any of those to work, then MetaMod Pro will fix the styling issues, but in your case you can probably get it to work without going Pro.

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

Re: Login/Logout Module Display Not working?

Hi,

I working till quite late trying tonnes of different ways to make it work but it just wouldnt do it.

However, I managed to solve the issue. I found this module called: Advanced Module Manager, which adds "Module Parameters" in each and every module in the backend, where you can specify which users to allow to see that module, with the "exclusion" of other user groups.

Thanks for your assistance!

umersaeed
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5940
Posts this week:
1
User Info:
 
Total Users:
5193
Newest User:
david2398
Members Online:
1
Guests Online:
143

Online: 
Technichem

Forum Legend:

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