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 Front Page Items

Hide Front Page Items

Hey Stephen,

I am performing a check to see if the logged in user has selected their community id.  If not, then I want to display a couple of modules for them to do so.  It is working great, however, because the login returns the user to the Front Page, I am stuck with all of the modules that are displayed on the front page in addition to the notification that they have not selected a community id which then gets lost.

I want to have a blank page where the only thing that shows is this information. Any suggestions?  I tried the instructions for disabling the modules that are found on the front page, but they still showed up.  This is the code that I am using.  Any help you can provide would be wonderful!


$user_id = $db->getEscaped((int)($user->id));
$app = &JFactory::getApplication();

if ($user_id > 0) {
$query = "select * from #__user_community  where user_id = '$user_id';";
$db->setQuery( $query );
$row     = $db->loadObject();
$community = $row->PleaseSelectYourCommunity;
}

if (MM_LOGGED_IN)
  if ($community > 0)
   $app->redirect("/georgia/community");
  else
    $changes->mod(430)->disable();

slboone
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Hide Front Page Items

Hi Sondra,

(1) it appears that even with MetaMod Pro, at this time you can't disable other modules on the page. I don't know why this is (not) happening, but I want to fix that for the next release. Sorry about this - that was always one of the key reasons for MetaMod Pro, to be able to alter modules even if they are in different module positions.

(2) until that's fixed, then the only way to create a page that doesn't have any modules on it is to NOT assign any modules to "All" pages - instead, either manually assign them to all pages except the page you're working on here, *or* put all your other modules into MetaMods, and get the MetaMods to assign them onto all pages except the target page.

I know, that's a bit messy.

One thing you can do to make it slightly less messy, is to append something to all the module position names for the modules. i.e. for every module assigned to "right", change that to "right-holder". Repeat for all your modules.
Then, create 1 MetaMod for each module position, and use a rule like:
if (... we're not on the target page...) return "right-holder";

So then, it's real easy to add new modules etc. Just treat "right-holder" like you treated "right", and the MetaMods will take care of all the rest.

Hope that helps,
Cheers,
Stephen
p.s. next week I am finally going to have some time to work on MetaMod, so I'll see if I can fix that bug.

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

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Posts this week:
4
User Info:
 
Total Users:
5533
Newest User:
gregg25476
Members Online:
1
Guests Online:
121

Online: 
gregg25476

Forum Legend:

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