yiibjorn
(Bjorn)
January 27, 2014, 4:07pm
1
Hi,
Is there any possibility to use the ScriptMap option when using themes?
In my main config I’ve got this right now:
'clientScript'=>array(
'scriptMap' => array(
'jquery.js' => 'js/jquery/jquery-2.0.3.js',
'jquery.min.js' => 'js/jquery/jquery-2.0.3.min.js',
),
),
I’ve got global scripts like jquery and custom scripts for different themes.
Directories:
js/
jquery/
themes/
default/
js/
css/
images/
special/
js/
css/
images/
yiibjorn
(Bjorn)
January 30, 2014, 10:16am
2
I think I found a solution. Just don’t use the same names in different themes for script files. But something like default-functions.js and special-functions.js. So the scriptmap works like always but is pointing to different themes. Good solution?
'clientScript'=>array(
'scriptMap' => array(
'default-functions.js' => '../themes/default/js/all.min.js',
'default-homepage.js' => '../themes/default/js/all.min.js',
'default-user.js' => '../themes/default/js/all.min.js',
'special-functions.js' => '../themes/special/js/all.min.js',
'special-homepage.js' => '../themes/special/js/all.min.js',
'special-user.js' => '../themes/special/js/all.min.js',
),
),