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.

 

PHP Newb. Please Halp!

Re: PHP Newb. Please Halp!

Did you want the feature listing on other pages as well? Which ones? This will only require a small change to the recipe.

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: PHP Newb. Please Halp!

Can you turn on advanced debug on those pages as well? We can probably enable the module just from choosing URL parameters for those pages, and adv debug mode will give us that info, if it's showing on those pages.

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: PHP Newb. Please Halp!

Okay, I have it on - thanks again!

Rebecca
Beginner Modder
ranks
useravatar
Offline
8 Posts
Administrator has disabled public posting

Re: PHP Newb. Please Halp!

ok, try this:

if ( ( $option == 'com_content' and $view == 'frontpage' ) or ( $option == 'com_jreviews' and $Itemid == '23' )) {
  return 89;
}
if ($option == 'com_content' and $view == 'article' ) {
  $intid = (int)$id;
  $query = "select jrc.featured from #__jreviews_content jrc where jrc.contentid = $intid";
  $db->setQuery( $query, 0, 1 );
  $featured = $db->loadResult();
  if (!$featured) return 89; /* replace XXX with the module id of the module to include */
}

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: PHP Newb. Please Halp!

*HUG* *HUG* *HUG* *HUG* *HUG*

I will sing praises on the jreviews boards about your module and service.   Amazing!  Thank you so much!

Rebecca
Beginner Modder
ranks
useravatar
Offline
8 Posts
Administrator has disabled public posting

Re: PHP Newb. Please Halp!

Rebecca wrote:

  The only side effect I can see is that the module does not show up anywhere else except on listing pages that are not "featured".   But this is something I can work around.

Hello

I try to do exactly the same thing of you... At my side everything work perfectly except the fact my module is displayed only in "non-featured" listing even if I set to "all" my Menu Assignment in both Metamod and Jreview listing module...

Have you find a solution for let us display the module based on our Menu Assignment ?? It seem Metamod don't take care about Menu assignment....

Or is necessary to always modify the code for include all Menu Items ID we want the module load??

many thank

dotcom22
Junior Modder
ranks
useravatar
Offline
21 Posts
Administrator has disabled public posting

Re: PHP Newb. Please Halp!

Hi dotcom22,

Could you please give some more details about how you have your system set up at the moment, and exactly what you are trying to achieve? It's a bit hard to guess based on the fact you're trying to do the same as someone else...

e.g. are you using MetaMod already?

MetaMod *can* care about module assignment - just assign the MetaMod to whichever menu items you want. But sometimes you might want to assign it to "all" and restrict it using different criteria. It can work either way.

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: PHP Newb. Please Halp!

thank for reply...

You right...In fact I currently installed Metamod and my goal is to do like Rebecca that mean I need to display some module only in Jreview non-featured listing and is some other location of my site...

For do that I have set the follow php code:

Code:

if ($option == 'com_content' and $view == 'article' ) {

  $intid = (int)$id;
  $query = "select jrc.featured from #__jreviews_content jrc where jrc.contentid = $intid";
  $db->setQuery( $query, 0, 1 );
  $featured = $db->loadResult();
  if (!$featured) return 30;
}

This work well but like Rebecca, modules are only displayed in non-featured listing and in no else location of my site...

I already set "ALL" concerning Menu Assignment to my modules and in Metamod reason why I don't understand why I'm unable to see modules except in non-featured listing..

It seem a specific php code is missing for let Metamod to take care to Menu Assignment settings...

any clue please?

thank

dotcom22
Junior Modder
ranks
useravatar
Offline
21 Posts
Administrator has disabled public posting

Re: PHP Newb. Please Halp!

The recipe you quoted does exactly that - it places the module only onto pages that are not "featured".

If you set the MetaMod to "All" pages, then all that means is that the code gets run on all pages... but then the code detects if it's a featured JReviews item, and only displays a module if it's NOT featured.

The reason it's set to ALL pages is so that the JReviews pages can be detected on ALL menu items (or none) -- it doesn't mean that the target module itself is going to display on all those pages.

If you want to display a module on certain set pages (menu items), PLUS any pages that are non-featured JReviews items, then I'd do this:

1 - set up the target module as a completely normal Joomla module, and assign it to the menu items that you want it to appear on normally. (not the non-featured jreviews ones)

2 - set up a MetaMod assigned to ALL pages, or restricted if you want to.

3 - in the MetaMod, use the recipe above, and return the module id of the module you set up in (1).

In this way, the "normal" module works in 2 ways. Firstly it goes onto the pages where you assign it, in the normal way. Secondly, the MetaMod can also include this on any pages that have non-featured JReviews items.


Does that make sense?

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:
1687
Total Polls:
6
Total Posts:
5939
Dormant:
User Info:
 
Total Users:
6578
Newest User:
jessicaeatock
Members Online:
0
Guests Online:
99

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