Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Need help with displaying module for...
Need help with displaying module for a particular category
Need help with displaying module for a particular category
Hi I use metamod pro for a while now, but I have difficulties to show a seperate menu for a particular category.
This is my code:
Code:
if ( MM_LOGGED_IN ) {
if ( JRequest::getVar('task') == 'edit' ) return "";
else return "24, 39, 21, 40";
if ( $option == 'com_joomla_flash_uploader' ) return "";
else return "24, 39, 21, 40";
if ( $option == "com_content" and $view == "article" and JRequest::getInt("catid",0) == '21') return "";
else return "24, 39, 21, 40";
}
else return "20, 39, 29"; /* Not logged in users */
Everything is working fine except for the last part with the catid. I am trying to show no modules for a particular category, but when I view the specific page nothing happened. All the modules still showing.
Who can help me with this?
24-Jun-10 11:34:26
Re: Need help with displaying module for a particular category
Hi Carmen,
The problem with the code above is that the "else" statements in the part for logged-in users will stop execution passing through to the code below.
Step through the code with me...
... if user is editing, don't return a module,
... else return several modules
So after that line, it's not going to get any further down the rule. If the user is editing, it returns nothing; if user is not editing, the other list of modules is returned. In either case, PHP will go no further down the rule.
So, I would re-organise the rule like this:
Code:
if ( MM_LOGGED_IN ) {
if ( JRequest::getVar('task') == 'edit' ) return "";
if ( $option == 'com_joomla_flash_uploader' ) return "";
if ( $option == "com_content" and $view == "article" and JRequest::getInt("catid",0) == '21') return "";
return "24, 39, 21, 40"; // these will be returned when not editing, not in flash uploaded, and not an article in category 21
}
else return "20, 39, 29"; /* Not logged in users */
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Need help with displaying module for...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Posts this week:
- 2
- User Info:
- Total Users:
- 7643
- Newest User:
- ulmer60661
- Members Online:
- 1
- Guests Online:
- 138
- Online:
- ulmer60661
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked