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.

 

Display on K2 item pages for specific category

Re: Display on K2 item pages for specific category

Ok, try these. I'm not 100% familiar with the K2 terminology, so this may need tweaking, but here goes:

- only on specific K2 category pages:

if (
$option == 'com_k2'
and $view == 'itemlist'
and JRequest::getVar('task') == 'category'
) {
  $catid = (int)$id;
  if ($catid == 1) return XXX;
  if ($catid == 2) return YYY;
// etc.
}

Replace XXX and YYY with the module ids to use for cats 1 and 2. Customise as appropriate.


- only on all category pages:

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 or position to display */


That latter one combines both the "all categories" view with any particular individual category view.


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

Re: Display on K2 item pages for specific category

Thank you very much for your help and fast response time.  I sent you a donation for a drink

Big Thanks Again smile

kaizagency
Beginner Modder
ranks
useravatar
Offline
13 Posts
User info in posts
Administrator has disabled public posting

Re: Display on K2 item pages for specific category

Thanks - that helped take the kids to the funfair on Saturday smile

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

Re: Display on K2 item pages for specific category

Hello..

I want to hide the top_right column for specific K2 categories (items will do too), but it doesn't work! I only want it to load the top_right position when it loads a module too.

I tried with this:
<div id="gk-right" class="column" style="width:<?php echo $r ?>%">
    <?php if ($this->countModules($right_top) and ! (JRequest::getVar("option") == "com_k2" and JRequest::getVar("view") == "item" and JRequest::getInt("id",0) == 7 )): ?>
    <div class="gk-mass gk-mass-top clearfix">
        <jdoc:include type="modules" name="<?php echo $right_top; ?>" style="gavickpro" />
    </div>
    <?php endif; ?>

The column still does load in the article even though it doesn't contain a module.

Can anyone help?

Denmark
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: Display on K2 item pages for specific category

Hi Denmark,

I think that the issue is that a MetaMod always "exists" (as long as it's published) even if it doesn't decide to include other modules. Hence the "countModules()" is always > 0.

This problem disappears with MetaMod Pro. MetaMod Pro makes it so that if the MetaMod does not contain any modules, then the MetaMod itself completely disappears from the module position, and countModules() won't see it.

See FAQ:
http://www.metamodpro.com/metamod/faq/2 … etamod-was

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:
1697
Total Polls:
6
Total Posts:
5941
Total Posts Today:
1
User Info:
 
Total Users:
5421
Newest User:
garena99
Members Online:
0
Guests Online:
395

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