Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Trivial
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: User Interface
-
Labels:None
-
Environment:All
Description
At present, the css / smarty templates are assigned using the theme variable in config.ini but the theme directory has to be harcoded into the css template:
background-image:url(<?php echo $configArray['Site']['path'];?>/interface/themes/default/images/author_bg.jpg);
If the theme variable was used instead: - background-image:url(<?php echo $configArray['Site']['path'];?>/interface/themes/<?php echo $configArray['Site']['theme'];?>/images/author_bg.jpg); - no changes to the styles.css file would be needed. This would also create the opportunity for changing style sheets "on the fly". A user could select a different theme which could be stored in their account settings as a default theme or in a session field which could be used for the duration of that session or for particular IP addresses.
E.g.
if ($user['theme']) { // use user selected theme }
else if ($_SESSION['theme']) { // Use Session Theme }
else { // use theme specified in config.ini }
background-image:url(<?php echo $configArray['Site']['path'];?>/interface/themes/default/images/author_bg.jpg);
If the theme variable was used instead: - background-image:url(<?php echo $configArray['Site']['path'];?>/interface/themes/<?php echo $configArray['Site']['theme'];?>/images/author_bg.jpg); - no changes to the styles.css file would be needed. This would also create the opportunity for changing style sheets "on the fly". A user could select a different theme which could be stored in their account settings as a default theme or in a session field which could be used for the duration of that session or for particular IP addresses.
E.g.
if ($user['theme']) { // use user selected theme }
else if ($_SESSION['theme']) { // Use Session Theme }
else { // use theme specified in config.ini }
Issue Links
| This issue is incorporated by: | ||||
| VUFIND-50 | Switching between themes |
|
|
|
An approach that might work with more static CSS files yet allow CSS switching would be to define custom themes that inherit from a base theme. Each of these child themes would just include a CSS file that @imports the styles.css file from the parent theme and then override images and other styles as needed. All paths could be relative, and things would still work out.