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 category

K2 category

I want a specific bannermodule to show in sidebar next to articles in a specific K2-category.
Is there any guide that shows how to do this?

Edited By: Melodrama
29-Aug-13 16:42:17

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

Re: K2 category

Hi,

I still need to write up a full recipe for this, but this will get you going:

$k2 = JomGenius("k2");
if ( ! $k2->check("pagetype = item.view")) return; // bypass if we are not on an item view page
$cat = $k2->info("category_id");
if ($cat == 1 ) return XXX;
if ($cat == 2 ) return YYY;
// replace XXX with module id to use for category 1
// replace YYY with module id to use for category 2
// and add as many more lines like this as you like...


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

Re: K2 category

Hi, a think your module it´s son interesting... Thanks for that

I`m testing on my site, i want to show banners on specific k2 categories, but a don´t understand how work.

=====
$k2 = JomGenius("k2");
if ( ! $k2->check("pagetype = item.view")) return; // bypass if we are not on an item view page
$cat = $k2->info("category_id");
if ($cat == 50 ) return 719;
// replace XXX with module id to use for category 1
// replace YYY with module id to use for category 2
// and add as many more lines like this as you like...
====

I had write in php tab the code that you exposed for category 50 and module id 79, but module not work, how i have assign module to menu select? i need to do something more?

Thanks so much for your support!!!

marcunix
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: K2 category

Hi,

in the example above, for cat 50 it will use module 719, not module 79. Is that what you intended?

Also, please read through the Quick Start guide to make sure you have everything set up properly:

http://www.metamodpro.com/metamod/quick-start

Also make sure that the MetaMod is published and set to display on some or all menu items - otherwise it won't work.

Best regards,
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: K2 category

Sorry, i was a mistake to write, module id  719 is correct.

I see 4 times quick start, and maybe i´m doing some wrong

My original module html, contain a picture what i need show on k2 item from a specific category, i test wiht position real and new create position module (logo-metamod).

I try assign to one item menu select and no item select

I´m lost

Thanks

marcunix
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: K2 category

1 - make sure MetaMod is published
2 - make sure MetaMod is assigned to some or all pages
3 - make sure MetaMod is assigned to a valid module position
4 - the "target module" (719) is best to be assigned to a fake module position (e.g. logo-metamod), and keep it published.

If you want to check which page you are on, and which K2 category you are on, you could try this at the beginning of your rule:

$k2 = JomGenius("k2");
echo "page type: " . $k2->info("pagetype") . "<br>";
echo "category id: " . $k2->info("category_id") . "<br>";

Then navigate to the pages that you want to target, and check that they are really the right page type and category id.

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

Re: K2 category

I can´t resolve sad

1 - OK
2 - Some pages don´t work, if assigned all pages works, but i don´t want show on all pages, only for specific category id
3 - OK
4 - OK, i assigned to logo-metamod new create position

It´s possible to pay for support review and fix?  Your module it´s so interest for me that I do not mind paying for it to work

Thanks so much

marcunix
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: K2 category

Ok, that's progress:

with (2) you say that you don't want it on all pages. But even though you assign the MetaMod to all pages, the target module (719) will only appear on the specific pages that you want it to (item pages in category 50).

So is that part working?

I suspect that you are noticing that a "blank" module appears on all the other pages that the MetaMod is assigned to, even when it's not the item pages in cat 50. Is that correct?

If that's correct, then the easiest way to get around it is to use the Pro version. In Pro, the MetaMod completely disappears and even allows the module position to collapse when the MetaMod does not include any other module.

Cheers,
Stephen

p.s. happy to help you get this set up, but at the moment I think it's probably a basic thing like I explained above.

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: K2 category

Ok, i assign metamod module to all pages, but don´t show nothing, i observed that module show on all pages when original module html it´s assign to all pages.

So, when i turn position module html to ''logo-metamod'' don´t show any place.

marcunix
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: K2 category

Try creating a new MetaMod, assign to all pages, and use the following PHP:


$k2 = JomGenius("k2");
echo "page type: " . $k2->info("pagetype") . "<br>";
echo "category id: " . $k2->info("category_id") . "<br>";


Then look at the pages that you are trying to target. What page type does it say they are? What category id does it say? Are these the ones you are trying to target? And when you are on a category page what does it say?

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:
1689
Total Polls:
6
Total Posts:
5941
Posts this week:
1
User Info:
 
Total Users:
5349
Newest User:
tony55549
Members Online:
0
Guests Online:
111

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