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.

 

What's the best way?

What's the best way?

I have been a die-hard user of Metamod Pro since 2011 and finally bought chameleon.  On my current site which runs jomsocial and most recent joomla version, I would like to remove the left column only for jomsocial.  Currently what i am doing is using a custom css module and a hidden position to place the custom css code which technically does the job of removing is via css, however, it does so after the page has already rendered resulting in even long load time and the worst part is for a brief second, the user can still see the left column before it's overridden and jomsocial changes size to fill it in.. I got chameleon because I am looking to make this specific change before the page is already rendered.  I still want to use the same template just remove left column, have component enlargen to fill it in and keep right column only for jomsocial.

Hope this wasn't too confusing smile

Adam

redlinesuperstore
Guest
useravatar
Offline
Administrator has disabled public posting

Re: What's the best way?

The only file that needs to be changed come to think of it, is the index.php file which sets the template's structure.  If I want to keep the existing template and just change the index.php file for the jomsocial component only , what would I have to do in chameleon to make it happen? Or would there be a way I could have the css overrides happen earlier so the user doesn't see the css changes take effect after it's already been rendered?

Thanks again

amelcher
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: What's the best way?

Steven,

You still around?

amelcher
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: What's the best way?

Yes, still around, sorry about the long silence as I have been away and had less internet connection and time than I anticipated.

If you want to signal something from Chameleon to your template, you can do it like this:

- in the Chameleon Succeed Action there's a PHP box. In that box, set a global variable like this:

global $my_chameleon_success_flag;
$my_chameleon_success_flag = true;

This variable will get set only if that rule succeeded.

- In the template, you can now refer to this global variable:

global $my_chameleon_success_flag;
if (@$my_chameleon_success_flag == true) {
  // do something here
}

Or if you want to use the flag to prevent something from happening, you could do it like this:

global $my_chameleon_success_flag;
if (@$my_chameleon_success_flag == false) {
  // do something here
}


You were asking about how to use this to make changes for a particular component, jomsocial. So what you could do is make a rule in Chameleon that detects the component jomsocial (using the select box), then set the global variable in the PHP box as above, and test the global variable in the index.php of the template, as above.

Another approach would be to add CSS code using the Succeed Action.
Another approach might be to use the new find&replace actions in the Succeed Action to remove any items of HTML coding that you don't want on the page under certain conditions.

There are lots of ways you might want to do this – I hope this gives you a start on 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
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10112
Newest User:
chris28464
Members Online:
0
Guests Online:
118

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