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.

 

Recipe to display module only in category or section blog layout

Recipe to display module only in category or section blog layout

Hi, just wondering if could tell me or has created a receipe to display two modules only in a category or section blog layout and to disable the modules from the subsequent article linked to the blog? Newbie any help appreciated.

adamwclarke
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Re: Recipe to display module only in category or section blog layout

Hi Adam,

that's a nice easy one. Try the following, where 101 and 102 are the modules that you want to display only on the blog/list pages, and not the subsequent article pages:

Code:

if ($option == "com_content" and ($view == "category" or $view == "section") ) {

  return "101,102";
}

Note: for left and right columns, depending on your template, you might get issues of a blank column showing up on the article pages. That happens when the template detects that there's a published module in that column (the metamod itself, even with nothing in it), and reserves space expecting there to be something there. There's more information about that in this FAQ. MetaMod Pro is the easiest way to stop that happening.

Hope that helps,
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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Recipe to display module only in category or section blog layout

Hi Stephen, worked great thanks for the recipe and your help

adamwclarke
Beginner Modder
ranks
useravatar
Offline
14 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10778
Newest User:
negina4qx
Members Online:
0
Guests Online:
146

Online: 
There are no members online

Forum Legend:

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