Skip to content

Instantly share code, notes, and snippets.

@shamsbd71
Created August 8, 2016 08:57
Show Gist options
  • Save shamsbd71/3782a5830775263d89c2c1bc46c9b7de to your computer and use it in GitHub Desktop.
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.
# 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