1265 Posts in 351 Topics by 486 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 659 Views |
-
Set default theme (SSViewer::set_theme) programatically in _ss_environment.php instead of _config.php

7 October 2011 at 4:16pm
Hi,
We've structured our SS projects so that all project specific configuration goes into _ss_environment.php, leaving _config.php to be as generic as possible, so that we can include it in our SS project boilerplate.
One thing that unfortunately is project specific is the call to SSViewer::set_theme(). From our reading of the forums, we get the impression that it is recommended to set a default theme programmatically, so we'd like to do that somewhere.
The question is where can we do this (preferably somewhere project-specific like _ss_environment.php) and outside of _config.php.
Is what we're doing here, OK... we define a constant in ss_environment.php that is then used in the _config.php's SSViewer::set_theme call. Eg...
_ss_environment.php
...
define('SS_PROJ_DEFAULT_THEME', 'MyDefaultTheme');
..._config.php
...
SSViewer::set_theme(SS_PROJ_DEFAULT_THEME);
...Seems to work well. Sounds OK?
Thanks for your input.
VWD.
-
Re: Set default theme (SSViewer::set_theme) programatically in _ss_environment.php instead of _config.php

7 October 2011 at 9:51pm
This is perfectly fine. The reason you cannot use SSViewer::set_theme() in your environment is that the class isn't loaded but a constant is perfectly valid to be used.
-
Re: Set default theme (SSViewer::set_theme) programatically in _ss_environment.php instead of _config.php

7 October 2011 at 10:35pm
Thanks Will - appreciate your response very much.
VWD.
| 659 Views | ||
|
Page:
1
|
Go to Top |


