Template changer independently of users choice

6 years 7 months ago #297714 by activha
Hello

We have developed an ios app using web view and CB
On the main site we use JF SIRENA CB template. On the web view we would like to use flexistrap template.
However Flexistrap loads if sirena CB template by default.
I thought of using Template changer plugin but it seems for users mainly.
We use Chameleon and also menu template affectation for Flexistrap.
Do you have any hint of what we could use for setting default CB template when using Flexistrap ?
Php code in Chameleon ?? Which one ?) or any auto action maybe ?
Thanks for the assistance
I’ll be glad to show you the ios Android app once finished if you are interested
Best regards
Jean

Please Log in to join the conversation.

6 years 7 months ago #297725 by krileon
You could use CB Auto Actions to change the template. The below can be used to change the template before profile loads.

Global
Triggers: onBeforeUserProfileRequest
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
global $ueConfig;

$ueConfig['templatedir'] = 'default';

If you want it to also work on profile edit then also use the onBeforeUserProfileEditDisplay trigger. You'll need to figure out what conditions you need to use though as you'll need to somehow condition against what template is used.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 7 months ago #297756 by activha
That's not easy to define a condition.
I thought of setting a session variable A with the composant Chameleon but is it possible to retrieve it with your conditions ?
The other way would be to add php lines when chameleon changes the template, but, in this case, what would be the correct code to use the triggers and define CB template when Chamelon changes the website template ?

Please Log in to join the conversation.

6 years 7 months ago #297757 by krileon

I thought of setting a session variable A with the composant Chameleon but is it possible to retrieve it with your conditions ?

Yes and no. You can't access the Joomla session, but you can access PHP session with [session_VARIABLE].

The other way would be to add php lines when chameleon changes the template, but, in this case, what would be the correct code to use the triggers and define CB template when Chamelon changes the website template ?

I guess a Code field with the code to return what the loaded template is may work, but I've no idea if this is based off some sort of client side variable that may not be present when the code field is ran. Sorry, I don't use Joomla API enough to find out what Joomla template is loaded to provide you an example.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 7 months ago #297770 by activha
Thanks but I'll try to figure out something

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.217 seconds

Facebook Twitter LinkedIn