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.

 

Is it possible to disable a plugin on pages except 1 using Chameleon ?

Is it possible to disable a plugin on pages except 1 using Chameleon ?

Hi Stephen,

Hope you are fine. is it possible to turn on or off a plugin using chameleon? I want this plugin to load only on one page and the plugin does not have any such option.
If its not possible with Chameleon, can you suggest a couple of lines on how to do this by editing the plugin ?

Thanks

Tijj
Beginner Modder
ranks
useravatar
Offline
18 Posts
Administrator has disabled public posting

Re: Is it possible to disable a plugin on pages except 1 using Chameleon ?

I forgot to mention that I tried a rule with chameleon that checks for the menu item and I pasted the code of the entire plugin in run php box.

This is a system plugin so its order may be an issue.

I even tried pasting parts of the plugin. Simple echo statements I added to check worked but the plugin itself does not load. I also tried include statement to add the php but that did not work too.

Thanks

Tijj
Beginner Modder
ranks
useravatar
Offline
18 Posts
Administrator has disabled public posting

Re: Is it possible to disable a plugin on pages except 1 using Chameleon ?

Hi,

plugins are generally more complex than just running the code - often needs its appropriate context, so I am not surprised it doesn't work.

I've just spent part of the morning working on how to get Chameleon to disable other system plugins and I'm making some progress. It may even be able to disable some other plugin types but that may be more complex. I hope to be able to put this into a future version of Chameleon but it's not going to happen in a hurry - sorry.

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: Is it possible to disable a plugin on pages except 1 using Chameleon ?

Oh you are so going to love this! (Joomla 2.5, may work on 3.x but not yet tested)

You can use the following in the PHP box in the Succeed or Fail action, to disable system plugins:

/* The name of the system plugin to disable. Must be all lower case.
* Must occur in order AFTER the Chameleon system plugin.
*/
$classtodelete = 'plgsystemhighlight'; /* edit this! */
$dispatcher = JDispatcher::getInstance();
$rProperty = new ReflectionProperty($dispatcher, '_observers');
$rProperty->setAccessible(true);
$obs = $rProperty->getValue($dispatcher);
foreach ($obs as $ob) {
  $class = strtolower(get_class($ob));
  if ($class == $classtodelete) {
    $dispatcher->detach($ob);
  }
}


So in your case you could make a Chameleon rule to detect the page you want to ENABLE the plugin on, then in the FAIL action use the PHP above. Of course the plugin needs to be enabled to start with.

I'd love to know how you get on with this.

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: Is it possible to disable a plugin on pages except 1 using Chameleon ?

Thank you Stephen -  I will test this out and let you know.

I will also write a 5 star review for you in JED.

Tijj
Beginner Modder
ranks
useravatar
Offline
18 Posts
Administrator has disabled public posting

Re: Is it possible to disable a plugin on pages except 1 using Chameleon ?

Hi again - forgot to mention that I built this in to Chameleon last night and released it, so if you download the most current version (v2.35) you get the GUI with it. Even if I say so myself... this is an AMAZING feature. Thanks for your encouragement to investigate and develop the feature!

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:
1698
Total Polls:
6
Total Posts:
5944
Posts this week:
4
User Info:
 
Total Users:
5533
Newest User:
gregg25476
Members Online:
0
Guests Online:
116

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