Can a module show only to visitors, but not to members?

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
konabear
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Sep 13, 2006 7:38 pm
Contact:

Can a module show only to visitors, but not to members?

Postby konabear » Thu Jun 26, 2008 2:33 am

I know how to make a module that is visible only to registered users. But is it possible to have a module that is not visible to registered users? For example, I'd like to have a module encouraging registration and it's benefits that shows for non-registered visitors, but that doesn't show for logged in members.

I'd also like to have a module that encourages users to register for access to a free download, but I'd like that module to be replaced by the module that offers the download once someone has logged in.

Any ideas?

???

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 21493
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, The Netherlands
Contact:

Re: Can a module show only to visitors, but not to members?

Postby pe7er » Thu Jun 26, 2008 9:17 am

You can use the following workaround:

Create a Module Position in your template that is only visible for non registered users with some code like:

Code: Select all

if ($my->id >0){
mosLoadModules('some_module_position', -1);
}

Assign the module (set level to "public") that should be visible to non-registered users (or for visitors that are not logged in) to the "some_module_position" module position.
Kind Regards,
Peter Martin, Global Moderator
http://www.db8.nl - Joomla specialist, Nijmegen, Nederland
Developer of db8 Site Dev http://extensions.joomla.org/extensions ... 8-site-dev

macsyrinx
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Feb 19, 2007 10:13 pm

Re: Can a module show only to visitors, but not to members?

Postby macsyrinx » Mon Mar 23, 2009 1:46 pm

Any way you can expand on that? I know how to create a new module position, but I have no idea where to put the code that you supplied. thanks.

User avatar
drdehart
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jul 15, 2008 2:38 am
Location: California
Contact:

Re: Can a module show only to visitors, but not to members?

Postby drdehart » Tue Mar 24, 2009 7:34 am

I have a related question - can a menu link show only to public (or guests) and be hidden for registered users?

User avatar
stevepops
Joomla! Intern
Joomla! Intern
Posts: 53
Joined: Tue Nov 27, 2007 2:28 am

Re: Can a module show only to visitors, but not to members?

Postby stevepops » Wed Dec 30, 2009 8:34 pm

Now you can use nonumber.nl s fantastic Advaced Module Management to do this

rickyvt
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jun 23, 2009 12:15 pm

Re: Can a module show only to visitors, but not to members?

Postby rickyvt » Wed Jan 19, 2011 10:24 am

Is it also possible to do this for components?

Riverside
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 213
Joined: Mon Nov 05, 2007 8:54 pm

Re: Can a module show only to visitors, but not to members?

Postby Riverside » Thu Apr 07, 2011 2:00 am

stevepops wrote:Now you can use nonumber.nl s fantastic Advaced Module Management to do this


Thanks for this tip! A fantastic plugin I must say. For advanced users with a lot more options than I anticipate ever needing, but you never know...

I happened upon this searching for a solution to a fairly unique (I think) need, and it works like a charm and wasn't difficult to figure out at all. I have a demo site where I wanted public users to visit and at least be able to see menus that would normally (on the production sites) only be available to registered users, but on the demo some would work, and others not work. But I also needed a second menu that is fully functional (in the same module position as the "dummy" menus).

So I needed a full, but not fully functional menu for public users ONLY, and a second, duplicate and fully functional menu in the same place, identical in every way except actually functional, available to all registered users.

This plugin did the job.

I had another, more convoluted solution planned that involved creating a totally duplicated environment (duplicate articles and other features) that would, in effect, create a whole collection of "pages" for public users with certain features disabled, and a duplicate identical area where everything actually works, for registered users.

It would have worked, but even though it took me about an hour to fully understand how this plugin works, that was far less time than it would have taken to set up two completely different environments.

Awesome plugin! Thank you VERY much! :D
Don't let the number of stars fool ya! I spend most of my time in the "real world" working with and troubleshooting Joomla and the many extensions for it.

ntodd7
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Thu Mar 08, 2012 4:23 pm

Re: Can a module show only to visitors, but not to members?

Postby ntodd7 » Thu Mar 08, 2012 4:28 pm

I found this thread useful, but it took a few minutes to find the component refered to, so here's the link for anyone else interested:

http://extensions.joomla.org/extensions/style-a-design/modules-management/10307

I hope that's the right one anyway - worked for me!


Return to “General Questions - 1.0.x”

Who is online

Users browsing this forum: No registered users and 4 guests