Your Themepicker extension seems to be an excellent resource. However, I am having difficulty set $themePath in a variation of the advanced template. Specifically, my directory structure looks like this:
-- yii2 (base application directory)
-- _protected
-- backend (what would normally be the backend in the advanced template)
-- common
-- console
-- environments
-- frontend
-- tests
-- vendor
-- assets
...
-- themes (where the actual theme directories reside)
I have tried multiple ways to define the $themePath variable so that it works and have gotten there, sort of. I can easily get the dropdown to correctly display all my themes by doing this:
Yii::setAlias('themes', realpath(dirname(__FILE__).'/../../../themes')); (in _protected/common/config/bootstrap.php
$themePath = \Yii::getAlias('themes'); (in ThemePicker.php, although I hate channging the source code for an extension)
However, when I try to switch themes, it falls apart because the css file that is handed off has a bizarre path in it. Specifically, the path is:
<link href="L:\xampp\htdocs\yii2\_protected\frontend/themes/almost-victorian/css/site.css" rel="stylesheet">
The path should be:
<link href="L:\xampp\htdocs\yii2\themes/almost-victorian/files/main_style.css" rel="stylesheet">
I'm also using themes from ThemeFactory.net which has the <THEME_NAME/files/main_style.css
way of storing the theme.
I've tried in vain to find out where that actual, bizarre path is coming from and how to reset it. I'm not sure if it's coming from your extension or elsewhere.
Can you give me any help on this?
Actually, I just answered my own question. I modified the Themepicker bootstrap.php file to read:
'pathMap' => [
//'@app/views' => '@app/themes/' .$themeName ,
'@app/views' => \Yii::getAlias('themes') . '/' . $themeName,
'@app/modules' => '@app/themes/' .$themeName . '/modules',
],
//'baseUrl' => '@app/themes/' .$themeName
'baseUrl' => '/' . \Yii::getAlias('themes') . '/' . $themeName,
You might want to consider including this in your somewhat scanty instructions. I took me quite a while to figure it all out.
Now I have two additional issues.
First, when attempting to switch themes, I have to choose the same theme from the dropdown TWICE before it will actually change. Selecting it just once does nothing.
Second, there don't seem to be any hooks for styling the widget. I'd like to include in my topnav navbar, but that requires adding some very specific classes and such to the select. Do you have any suggestions?