Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: Wishlist
-
Component/s: User Interface
-
Labels:None
Description
Hi,
I hope this is the right way to submit code extensions which might be of interest to other vuFind implementers as well?
Background and requirement: We would like to run one central vuFind installation for the complete MPG, but to offer some localization options (e.g. filter and theme selection) for individual sites or groups of sites. Therefore, we extended the vuFind code slightly to enable switching between themes by providing an additional key-value pair.
Modifications:
1. web/sys/Interface.php
[...]
$this->template_dir = "$local/interface/themes/$theme";
$this->compile_dir = "$local/interface/compile";
$this->compile_id = $theme;
$this->cache_dir = "$local/interface/cache";
[...]
2. web/index.php
[...]
// MPG extension: set theme
if (isset($_GET['mytheme'])) {
$theme = $_GET['mytheme'];
setcookie('theme', $theme, null, '/');
} else {
$theme = (isset($_COOKIE['theme'])) ? $_COOKIE['theme'] :
$configArray['Site']['theme'];
}
$local = $configArray['Site']['local'];
$interface->template_dir = "$local/interface/themes/$theme";
$interface->compile_id = $theme;
$interface->assign('userTheme', $theme);
// MPG extension: end
[...]
solution: http://gwda185.gwdg.de/vufind/?mytheme=mpdl
many greetings,
inga
p.s.: please be advised that this was my first php modifcation ever :)
I hope this is the right way to submit code extensions which might be of interest to other vuFind implementers as well?
Background and requirement: We would like to run one central vuFind installation for the complete MPG, but to offer some localization options (e.g. filter and theme selection) for individual sites or groups of sites. Therefore, we extended the vuFind code slightly to enable switching between themes by providing an additional key-value pair.
Modifications:
1. web/sys/Interface.php
[...]
$this->template_dir = "$local/interface/themes/$theme";
$this->compile_dir = "$local/interface/compile";
$this->compile_id = $theme;
$this->cache_dir = "$local/interface/cache";
[...]
2. web/index.php
[...]
// MPG extension: set theme
if (isset($_GET['mytheme'])) {
$theme = $_GET['mytheme'];
setcookie('theme', $theme, null, '/');
} else {
$theme = (isset($_COOKIE['theme'])) ? $_COOKIE['theme'] :
$configArray['Site']['theme'];
}
$local = $configArray['Site']['local'];
$interface->template_dir = "$local/interface/themes/$theme";
$interface->compile_id = $theme;
$interface->assign('userTheme', $theme);
// MPG extension: end
[...]
solution: http://gwda185.gwdg.de/vufind/?mytheme=mpdl
many greetings,
inga
p.s.: please be advised that this was my first php modifcation ever :)
Issue Links
| This issue incorporates: | ||||
| VUFIND-246 | Change Template Links to include theme variable |
|
|
|
I was unable to view the link posted but would be keen to see it in operation.