Created
August 8, 2016 08:57
-
-
Save shamsbd71/3782a5830775263d89c2c1bc46c9b7de to your computer and use it in GitHub Desktop.
For T3 Bases template, to allow randomly change the theme options, this will help.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# T3 Theme random preview | |
### For T3 Bases template, to allow randomly change the theme options, this will help. | |
#### Session has been used to keep the selection. | |
Opne your templates root folder and open `index.php` file and find this line: | |
```php | |
$t3app = T3::getApp($this); | |
``` | |
Add these codes after that: | |
```php | |
// addition for demonstration | |
$input = JFactory::getApplication()->input; | |
$session= JFactory::getSession(); | |
$theme = $input->get('theme', $session->get('theme')); | |
$params = $t3app->_tpl->params; | |
if(!empty($theme)){ | |
$params->set('theme', $theme); | |
$session->set('theme', $theme); | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment