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.

 

K2 display module on K2 Category and not K2 Item

K2 display module on K2 Category and not K2 Item

Hi. I'm new to Metamod so still figuring it out.

I have the following set up:

Main menu
>Child menu 1 (USA)
>>K2 Category 1
>Child menu 2 (CANADA)
>>K2 Category 1
>Child menu 3 (NEW-ZEALAND)
>>K2 Category 1
>Child menu 4 (AUSTRALIA)
>>K2 Category 1

The K2 Categories are all the same with the same items they just have a different message (module) that appears before the item list i.e. "Welcome from the USA", "Welcome from Canada" etc...

I want the relevant message module to only appear on the relevant item list page, however it also appears on the item page also. Even more annoyingly the if you click an item from the Canada list it shows the USA module.

Is there a recipe to only show on the item list page? Thanks!

blob
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: K2 display module on K2 Category and not K2 Item

Found it...

if (

  $option == "com_k2"

  and $view == "itemlist"

  and (JRequest::getVar('layout') == "category" or JRequest::getVar('task') == "category")

) return XXX; /* Replace XXX with the module ID*/

blob
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: K2 display module on K2 Category and not K2 Item

Looks good! I'm actually working on a JomGenius extension for K2 to make this sort of thing easier. Will release that for MetaMod and Chameleon in the next couple of weeks.

Cheers,
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
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Dormant:
User Info:
 
Total Users:
5595
Newest User:
gary099231
Members Online:
1
Guests Online:
545

Online: 
gary099231

Forum Legend:

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