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.

 

[solved] Recipe for Sobipro

[solved] Recipe for Sobipro

Hello,

I've been playing around with various recipes for a few hours now but not had any luck - Hoping someone could provide me with one to achieve what I want here.

I've got a custom position set up and have MetaMod set up correctly and working with anything I put in this position.

I am using a map module that displays a Google map that I want to display on each SUB CATEGORY page of SobiPro.

Currently the map shows on every SobiPro page.  The main category list, sub categories and listing page.

I have my SobiPro categories set up as follows:

E.G.  Europe > United Kingdom > Wales > Cardiff > LISTING PAGE.

I just want to get the map module showing on the cities part (in the example above, just on the "Cardiff" subcategory) - I know MetaMod can allow me to do this but I'm lost and have little PHP knowledge.

If someone could help me with this as I'm not having any luck, I'd be incredibly grateful.

Thanks

Edited By: metamodguy
21-Nov-13 20:20:22

Chekotay
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Recipe for Sobipro

If anyone could help me, I'd appreciate it smile

Chekotay
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Recipe for Sobipro

Hi Chekotay,

Can you switch on MetaMod's Advanced Debug mode, view the different page levels, then paste the results into the forum here? This is just to see whether the different pages you want to distinguish provide different results via the URL parameters. I have a feeling that this won't be enough (as you'll probably see the same sort of results from the "Wales" and "Cardiff" pages) but I just want to check.

In the end, we're looking for anything that can be used to distinguish the subcategories from each other. i.e. how might MetaMod be able to distinguish between when it's displaying "Wales" and it should not display anything, and "Cardiff" when it should? Perhaps there are tags or keywords associated with subcategories that it can utilise? (i.e. you could tag all the bottom level categories in some way). It may also be possible to determine that "the current category doesn't have any subcategories" so you could target just bottom-level categories. But that's going to take some investigation.

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

Re: [solved] Recipe for Sobipro

Thank you for the response Stephen.

Here is the code from the first category page - In this instance "Europe":

Code:

MetaMod debug info:

Module ID: 10381
$option: com_sobipro
$view:
$id:
$Itemid: 469
$timezone: UTC
$language: en-gb
$language_code: en
$language_region: gb
Including modules: mm-right

Here is the code for "Wales" (Europe > Wales):

Code:

MetaMod debug info:

Module ID: 10381
$option: com_sobipro
$view:
$id:
$Itemid: 469
$timezone: UTC
$language: en-gb
$language_code: en
$language_region: gb
Including modules: mm-right

Here is the code for "Cardiff" (Europe > Wales > Cardiff):

Code:

MetaMod debug info:

Module ID: 10381
$option: com_sobipro
$view:
$id:
$Itemid: 469
$timezone: UTC
$language: en-gb
$language_code: en
$language_region: gb
Including modules: mm-right

Guessing by the fact that they're all identical that this doesn't help.

I am not aware of a way to assign tags to categories/sub-categories - But I will look at this now.

Chekotay
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Recipe for Sobipro

Thanks for the debug output - however no help sad

I just downloaded SobiPro to work on this - glad to see it's free!

Here's some code you can use in MetaMod which can determine if you're in the "bottom" category, i.e. no further subcategories:

if ($option == "com_sobipro") {
  try {
    $sid = SPRequest::sid();
    $ob = SPFactory::object( $sid );
    if ($ob->oType == "category") {
      $kids = count( SPFactory::Category( $sid )->getChilds( 'category', false, 1 ) );
      if ($kids == 0) return XXX;
// replace XXX with the module id of the module to display when you are on a bottom level category.
    }
  }
  catch ( SPException $x ) {}
}


I think that should do it!
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
3328 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] Recipe for Sobipro

Really appreciate the response and assistance here Stephen.

Unfortunately this doesn't seem to work.  Module is still showing up on all the pages.

I can see the part to replace with the module ID.

MetaMod's ID is 10381 and it's published in the main-top position (where I want the map to appear).

The Map module's ID is 10378 and it's published in the mm-right position (the position I created and have selected in MetaMod).

I replaced XXXX with 10378 and the module still appears on all pages.  I also replaced it with MetaMod's ID to just to test and the same thing happens.

Chekotay
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Recipe for Sobipro

Do you by any chance have 10378 in the "quick module id or position include" box? If so you need to remove it from there. I think it's most likely that which is causing the map to appear on all pages.

So try that first and see what happens. If it still doesn't work then reply here again and I'll suggest some further debugging.

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

Re: [solved] Recipe for Sobipro

Aha, seems to be working!

In "quick module id or position include" I had the "mm-right" position that I created when I first installed the module, defined.  Upon removing this, the module appears only on the subcat/city pages, just as I wanted smile

I don't quite understand how that works, as I thought the basis of the module was that it needed to "know" a position for it to show the module.

But either way, it appears to be working perfectly!

Thanks very much Stephen!

Chekotay
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Recipe for Sobipro

The position that the target module will get inserted into is the position that the MetaMod itself is in. The MetaMod just acts as a container and "absorbs" other modules.

The "quick module id or position include" box is just a quick way to add other modules or modules from a named position into the output of the MetaMod. It doesn't tell MetaMod where to *put* the modules, just another place to *get* them from if you need to.

Anyway, I'm very glad it's all working for you. This is quite a cool use for MetaMod!

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4401
Newest User:
jason59312
Members Online:
0
Guests Online:
209

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