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.

 

jReviews - rewrite itemid

jReviews - rewrite itemid

In Jomsocial there is an app from jReview showing all favourite listings of that user. The link looks like this:

Code:

http://domain.tld/component/jreviews/favorites/user:84/

I want that link to use ItemID 218. I think there are to solutions:

1. I could show all  modules from ItemID 218 on that page/link too using that code:

Code:


if (
$option == 'com_jreviews'
and $Itemid == NULL
and JRequest::getVar('url') == 'favorites/user:84' /*!*/
) return 87;

The problem would be to show that module for ALL users something like that "favourites/user:*".

2. It would be the best to rewrite the page to an ItemID (218) - because the link is a submenu item from a menu split module. Than everything would be fine.

The debugger tells me for the link from above:

Code:


Page Identification
The PHP code below may be used to help MetaMod to identify the exact page that you are viewing. For help using this feature, please click here.
if (
$option == 'com_jreviews'
and $Itemid == NULL
and JRequest::getVar('url') == 'favorites/user:84' /*!*/
) return XXX; /* replace XXX with the module ID or position to display */
Note: lines starting with "and" and ending with /*!*/ contain rules that may be optional. You may wish to leave them out.
MetaMod debug info:
$option: com_jreviews
$view:
$id:
$Itemid: 0
$timezone: default
$language: de-de
$language_code: de
$language_region: de
Including modules: 87

Thank you in advance for every help!

getimo

getimo
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: jReviews - rewrite itemid

HI Getimo,

so the question is - how can you get your menu item to include the Itemid for that particular link?

With most components, if you have a menu link for the main component, then any links for pages within that component tend to inherit that 1st Itemid. e.g. if you want all the search pages to have an Itemid, then you need to just create a menu item that points to the main search component. Then everything falls into place.

Does the same thing apply for jReview?

Sometimes there are modules provided with an extension that point to particular pages in that extension (favourites / most recent whatever). Sometimes these don't add Itemids like they are supposed to. Is this the same in your case?

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: jReviews - rewrite itemid

Hello Stephen,

thank you for your reply.

Yes, that applies to jReviews except for that link. It seems that this is a bug. I reported that to the jReviews forum.
Since that could be a bug please forget everything what I told you wink

But I have a similar problem. I'm displaying a module at a specific ItemID. Is it possible to hide all other modules at that page?

getimo

getimo
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: jReviews - rewrite itemid

Hi getimo,

you can set up a MetaMod for each module position on the page, and use the same rule in each one to show the modules on every page except that one. It does take a bit of setting up, but does work.

Another way to do it is with MetaMod Pro. With MMP you can "turn off" any module on the page, from inside a single MetaMod. So you can do this:

if ( condition here... ) {
  $changes->mod(123)->disable();
  $changes->mod(125)->disable();
  $changes->mod(127)->disable();
  $changes->mod(129)->disable();
}

... 123, 125, 127 and 129 are all the other modules on the page. Add another line for each module that you want to turn off, on that page.
So that keeps everything inside just 1 MetaMod, which makes it easier to set up and handle.

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: jReviews - rewrite itemid

Thank you Stephen. Unfortunately, I don't know the syntax:

That doesn't work:

Code:

if ( 

$option == 'com_jreviews'
and $Itemid == '186'
and JRequest::getVar('url') == 'new:listing_s6_c38' /*!*/
) return 351;


{
  $changes->mod(87)->disable();
  $changes->mod(305)->disable();
  $changes->mod(202)->disable();
  $changes->mod(278)->disable();
  $changes->mod(274)->disable();
  $changes->mod(275)->disable();
  $changes->mod(276)->disable();
  $changes->mod(277)->disable();
}

What am I missing?

Is it possible to have several setups in the metamod too (I mean the whole codeblock - with different configurations - 4 times in 1 metamod)? That way I would not need to create many MetaMods.

PS: Yes, I'm using MetaMod Pro wink

getimo

getimo
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: jReviews - rewrite itemid

Code:

if ( 

  $option == 'com_jreviews'
  and $Itemid == '186'
  and JRequest::getVar('url') == 'new:listing_s6_c38'
)  {
  $changes->mod(87)->disable();
  $changes->mod(305)->disable();
  $changes->mod(202)->disable();
  $changes->mod(278)->disable();
  $changes->mod(274)->disable();
  $changes->mod(275)->disable();
  $changes->mod(276)->disable();
  $changes->mod(277)->disable();
  return 351;
}

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: jReviews - rewrite itemid

Hello Stephen,

thank you, I tried that already too but that doesn't work for me. Nothing changes but the module with the ID 351 is still there (which is right). I made a screenshot to show what I want to accomplish.
http://getimo.de/geb/metamod.png

Don't know if you have seen my edited question in the other post. Is it possible to assign that "module template configuration" for more than 1 link?


getimo

getimo
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: jReviews - rewrite itemid

1 - are you 100% sure that MetaMod Pro is installed on your server, and enabled, and 1st on the list of system plugins? I tested out disabling some modules as shown above, and it worked fine on my test server. But if MetaMod Pro is not operating, then it just won't work
2 - what version of MetaMod Pro are you using? The latest version is 2.3. If you are using an older version, that might have had a bug that prevented this from working properly. See http://www.metamodpro.com/metamod/metamod-pro for instructions on downloading the most recent version.

3 - I can't track down the post you are referring to regarding "module template configuration". Can you point me in the right direction?

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: jReviews - rewrite itemid

Ok, updated to latest version (module and plugin). That gives me that error only on the frontpage:

Fatal error: Cannot redeclare class JModuleHelper in /libraries/joomla/application/module/helper.php on line 30


How I updated:

1. First deinstalled the plugin and reinstalled with new version.
2. Overwritten the Module Files with the new version

Is that correct? Or do I have to uninstall all MetaMod Module and reinstall with the latest version? Are all my MetaMod Modules gone after that?
The disable function didn't work too.

With "module template configuration" I meant:

Instead of making these rules for only one URL is it possible to make this setup several times within one metamod with several urls.

getimo

getimo
Beginner Modder
ranks
useravatar
Offline
17 Posts
Administrator has disabled public posting

Re: jReviews - rewrite itemid

Hi getimo,

It sounds like you probably have another extension or plugin installed that's conflicting with MetaMod Pro. One candidate for this is BreezingForms - search this forum for a fix for that. But there are others too that directly import the file /libraries/joomla/application/module/helper.php instead of using the proper Joomla mechanism for doing so.

One work-around that may work, if you can't find the culprit, is to move the MetaMod Pro plugin to the top of the list of System plugins. e.g. give it an "order" number of -1 so it's before all the other ones. That can often help to make it load first.

Other than that, you may have to go through the other 3rd-party system plugins and disable them one by one until you find the one that was stopping MetaMod Pro from working.

Sorry for the inconvenience...

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:
1686
Total Polls:
6
Total Posts:
5933
Total Posts Today:
7
User Info:
 
Total Users:
4432
Newest User:
kinggambling14
Members Online:
0
Guests Online:
156

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