By Paul Murray on Sunday, 16 March 2014
Posted in Technical Issues
Replies 23
Likes 0
Views 748
Votes 0
Hi Support

Is it possible to hide modules if they are empty?

eg

Not Logged in:

GOING BEYOND THE FINAL BUG
Module: EasySocial Dropdown Menu [mod_easysocial_dropdown_menu]

Logged In:

FINAL BUG LOGIN BOX
Module: EasySocial Log Box [mod_easysocial_logbox]

On Community Page (Logged In) :

FINAL BUG TOOLBAR
Module: EasySocial Toolbar [mod_easysocial_toolbar]

I am guessing that the tool bar menu does not show on the community page when logged in because there is already another tool bar there!

thanks

Paul
Hello Paul,

Sorry but I am a little lost here. Can you please elaborate more about this please?
·
Sunday, 16 March 2014 13:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

Lets take a really simple eg like a log in box.

Obviously the login box is only useful when you are not logged in.

Module: EasySocial Log Box [mod_easysocial_logbox]

I am attaching 2 screen shots. The first is how "FINAL BUG LOGIN BOX" looks when not logged in the second when logged in

I probably was not very clear.

These modules are driving me crazy

best

Paul
·
Tuesday, 18 March 2014 20:08
·
0 Likes
·
0 Votes
·
0 Comments
·
There's actually an option "Show Logout Button" which you can set in the module settings.
·
Tuesday, 18 March 2014 22:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

I am sorry but now I do not understand!
"There's actually an option "Show Logout Button" which you can set in the module settings. "
Maybe I should emphasise that i am using the Module: EasySocial Log Box [mod_easysocial_logbox]
It is the big one that you put up on the top of the home page.
I am wondering if there is a way to hide this box completely once logged in!

thanks

Paul
·
Wednesday, 19 March 2014 01:20
·
0 Likes
·
0 Votes
·
0 Comments
·
hey paul,
to have more control about your modules you might want to take a look at the advanced module manager from nonumber: http://www.nonumber.nl/extensions/advancedmodulemanager

there you can for example tell your module that it should ONLY show up for guests but never for registered users and so on (plus lots of other options as well)... I guess that's what you're looking for - hope that helps
·
Wednesday, 19 March 2014 01:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, I think you are using a different module and not mod_easysocial_logbox because the module mod_easysocial_logbox does not display anything if you are logged in.
·
Wednesday, 19 March 2014 01:32
·
0 Likes
·
0 Votes
·
0 Comments
·
I am pretty sure that it is standard Easy Social stuff. Please see the screen shots...
·
Wednesday, 19 March 2014 01:45
·
0 Likes
·
0 Votes
·
0 Comments
·
I don't get it. Your second screen shot does not show any buttons after logged in? Are you trying to display something after the user is logged in or ?
·
Wednesday, 19 March 2014 02:13
·
0 Likes
·
0 Votes
·
0 Comments
·
No. I am not trying to display anything after the user logs in. If I am understanding this correctly the EasySocial login box should disappear when logged in which does not seem to be the case!
·
Wednesday, 19 March 2014 02:31
·
0 Likes
·
0 Votes
·
0 Comments
·
hey paul,
have you read my answer?? ^^ just download the advanced module manager and all your problems are solved
·
Wednesday, 19 March 2014 02:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Alex

I have it thanks and it is a huge help. Not sure about all of my problems being solved but my headache of the week has definitely been solved.

thank you Sir

Paul
·
Wednesday, 19 March 2014 03:00
·
0 Likes
·
0 Votes
·
0 Comments
·
@Alex, I'm a big fan of NoNumber extensions, but in my opinion advanced module management isn't needed. Joomla 3.2 has the guest usergroup in by default. Assuming it exist, simply set the module access to guest. If the access named "guest" does not exist, refer to the Joomla docs on how to create it: http://docs.joomla.org/How_do_you_hide_something_from_logged_in_users%3F
·
Wednesday, 19 March 2014 09:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing guys but here's the issue. The mod_easysocial_loginbox should never display any contents if the user is logged in. It is displaying the module header on your site probably because your template is enforcing the module title to appear even when there are no contents in the module.

This is the code that is in /modules/mod_easysocial_logbox/mod_easysocial_logbox.php


// If user is logged in, skip this
if( JFactory::getUser()->id )
{
return;
}
·
Wednesday, 19 March 2014 12:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

I am unsure how to proceed? Do I need to modify the code above? Contact the template people?

please advise

thanks

Paul
·
Monday, 24 March 2014 19:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Paul,

Hm, no you don't really need to modify the code because the code already states that if the user is logged in, nothing would be output from the module. Unless the template explicitly display the module title regardless if the content is empty or not.
·
Tuesday, 25 March 2014 03:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

Are you suggesting that I need to talk with the template people?

thanks

Paul
·
Wednesday, 26 March 2014 03:25
·
0 Likes
·
0 Votes
·
0 Comments
·
I signed up for the site to test this. Awaiting approval.
·
Wednesday, 26 March 2014 04:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Yep, that's right Paul. I can help you check on the site template if you can provide us with the FTP access.
·
Wednesday, 26 March 2014 12:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

It would be great if you could take a look at it. I am putting the FTP stuff down below

thanks in advance

Paul
·
Wednesday, 26 March 2014 16:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Paul,

It looks like the JSN Corsa Pro template is outputting the module title when there are no contents on the module. I have no idea why but I have added the codes below in the file /templates/jsn_corsa_pro/html/modules.php


if (!$module->content) {
return;
}
·
Wednesday, 26 March 2014 17:13
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

Thanks for that. I will tell them. It just does not make any sense to display the name of an empty module!!!

thank you

Paul
·
Wednesday, 26 March 2014 17:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

I am sorry for bringing this up again. But this is what I am seeing. Please see screen shots.
In other words even if the Module (Text) does not display there is still a space left where the empty module should have been.
Should I not contact the template people!?! Surely it is their responsibility?
Fixes are well and good but these days I am primarily interested in fixes which do not break again with the next update (e.g. template update)
This is all happening on the home page.
One more question this will effect all empty module on the Site? Yeah?

best
Paul
·
Wednesday, 26 March 2014 18:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Paul,

Yes, it's best to check with them because the code that I applied only fixes the title from not showing up. Their template still needs to check if there's any contents for that particular position.
·
Wednesday, 26 March 2014 22:36
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post