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.

 

Newb having immediate issues

Newb having immediate issues

Hello,

I have a site running at coloradoweb3.com

If I go to Historical Archives section, I have a module with Google Customer Search deployed. I'm trying to get this to only show up in this subsection. The problem is that I also have a tagging component that creates URLs like this:

http://coloradoweb3.com/srp-historical- … iam/tag/84

When I set my module to display on selected pages within this menu item, it never shows up on a link like the above.

So I set the module to display on All Except Selected, and checked everything except this menu tree and this worked fine, until I realized I have another module (Mijoshop Search) I only want to display on a different menu item and it's children. The problem here is the same. The component can generate links like this below:

http://coloradoweb3.com/component/mijos … y=whatever

...where my archive Google search module starts showing up where I don't want it.

Someone recommended your module - I just bought the pro version because it appeared there were some options to achieve what I was after, but when I try to match menu ID to module ID a la:

$mappings = array(
  155=>273,
);


$all_modules = array();
foreach ($mappings as $iid=>$mid) {
  if ( $menu_genius->check( "parent_item_ids = $iid" ) ) $all_modules[] = $mid;
}

return $all_modules;

155 is a parent menu ID. 273 is the Google search - but I can't get past this first step. Nothing appears where I was expecting. Shouldn't this code show module 273 on Menu ID 155 page and all it's children pages?

Thank you

Bill

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

Re: Newb having immediate issues

Hi Bill,

First let's make sure you've got the correct setup, and then once that's ok we can work on the best approach to targeting the pages that you need to target.

Setup:

1 - identify your target module. I think it's 173, the google search. For that module you need to disable it in some way: preferably by setting it to appear on "menu items: none". This is so it does not show up on any pages until/unless MetaMod includes it.

2 - ensure that the MetaMod is published and set to display on All, or All Except Selected (with every box checked).

3 - ensure that the PHP code in the MetaMod is accurate smile

Approach:

It seems to me like you want to identify 2 sets of pages:
1 - anything that appears on that particular menu item (historical archives)
2 - the Mijoshop URLs that seem to be on that menu item, but for some reason are not being attached properly, hence they don't show up when you assign the module to that menu item.

So let's tackle this directly, instead of doing the "identify mijoshop URLs by the fact that they're not on any menu item, but so are some other ones so we have to make an exception..."!

I think that there's likely something unique about the particular Mijoshop URLs that are being used, which you want to target. There's a feature in MetaMod called "Advanced Debug" which will help to identify these.

Can you please assign a new MetaMod to "all" pages, publish it, and turn on Advanced Debugging (setting in MetaMod)? Once this is done, can you please visit one of the tag pages and any other pages that so far have not been working properly, and make a note of the output from the MetaMod? It should be producing some sample PHP code. Then if you paste it into a reply to this message, then I can take a look at it and advise.
(then turn off debugging mode, as every site visitor will be able to see the output).

I imagine that the final result will look something like this:

if ($Itemid == 155) return 273; // everything directly in that section
if ($Itemid == '' and $option == 'com_mijoshop' and JRequest::getVar('tag') != '') return 273;


The second line is a complete guess and I don't expect it will be exactly that. But we'll get more information from the debug output.

Over to you,
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
3319 Posts
User info in posts
Administrator has disabled public posting

Re: Newb having immediate issues

Thanks Stephen,

So for our debugging experiment, I removed my attempted PHP. And I have an example page what won't show the Google search module:

It's own search result page!

http://coloradoweb3.com/index.php?optio … &hl=en


MetaMod debug info:
Module ID: 295
$option: com_googlesearchcse
$view:
$id:
$Itemid: 729
$timezone: UTC
$language: en-us
$language_code: en
$language_region: us
Including modules: None

If the mod shows up all other places I expect, should I duplicate the module for the sake of the Metamod process and only tackle those errant pages like this one? What would be the PHP syntax?

Thank you

Bill

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

Re: Newb having immediate issues

Hi Bill,

Did it output any PHP code? If not, can you put the debug mode onto "advanced" instead of "on"? Once we have some real output there, then we can work on the other questions.

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

Re: Newb having immediate issues

Hmm - ok the advanced mode seems to be suggesting some PHP to put in now:


if (

$option == 'com_googlesearchcse'

and $Itemid == '729'

and $jinput->get('hl') == 'en'

and $jinput->get('sa') == 'Search'

and $jinput->get('q') == 'abstracts'

and $jinput->get('ie') == 'ISO-8859-1'

and $jinput->get('cof') == 'FORID11'

and $jinput->get('cx') == '015285805448296192694r8fzh23brec'

and $jinput->get('n') == '30'
) return XXX; /* replace XXX with the module ID or position to display



*/MetaMod debug info:
Module ID: 295
$option: com_googlesearchcse
$view:
$id:
$Itemid: 729
$timezone: UTC
$language: en-us
$language_code: en
$language_region: us
Including modules: None

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

Re: Newb having immediate issues

So if Module 123 is what I want to show any time the Google search component is present in the URL, I would use:

if (

$option == 'com_googlesearchcse'

) return 123;

Is that all I would need?

Thanks

Bill

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

Re: Newb having immediate issues

HI Stephen,

OK so this works:

if (
$option == 'com_googlesearchcse' 
) return 301;

but what if I want to return two modules? I tried:

if (
$option == 'com_googlesearchcse' 
) return 301,208;

And this doesn't give me anything. What is the proper syntax here?

Thanks for your help!

Bill

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

Re: Newb having immediate issues

Hi Stephen - OK I realize I was being dumb about multiple modules (just use Arrays) but I'm struggling because I still need to be more granular than your detector/helper advanced debug code is giving me. Basically I have a menu with submenus all still reporting the same ItemID - the parent ID.

But I will need to show a different module, each on the 4 different child menu pages, and because these are Wordpress blog categories, I can't use the standard menu targeting in Joomla.

Basically, Wordpress is inserting one line in the URL which I think is breaking the regular menu function.

normally I would have coloradoweb3.com/blog/whats-cooking-at-srp

But Wordpress only recognizes

coloradoweb3.com/blog/category/whats-cooking-at-srp - since the menu structure with "category" in it doesn't really exist, I can't target these 4 submenus.

I don't see in the recipes anything where we can set a rule for a given URL structure for example:

if URL starts with coloradoweb3.com/blog/category/whats-cooking-at-srp/ then show the target module.

Is this possible?

Thanks - this is kind of urgent as this client wants their site live and I'm still stumped how to display some of this properly.

I hope meta-mod can still help!

Bill

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

Re: Newb having immediate issues

Stephen are you there?

It's been over a week since your last reply...

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

Re: Newb having immediate issues

Hi again,

1 - the easy way to return more than 1 module is like this:

return "1, 2, 3";

Returning an array also works.

2 - Yes, you can do detection based on URL portions. It's using something built-in to MetaMod called JomGenius. You can do rules like this:

if ($core_genius->check("url contains coloradoweb3.com/blog/category/whats-cooking-at-srp/")) return XXX;
if ($core_genius->check("url contains coloradoweb3.com/blog/category/srp-news-and-events/")) return YYY;
// replace XXX and YYY with the module ids you want to use for those URLs.

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

Board Info

Board Stats:
 
Total Topics:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11570
Newest User:
moises1247
Members Online:
1
Guests Online:
195

Online: 
moises1247

Forum Legend:

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