-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theme assets #87
Comments
What does the build file definition look like for the file your having trouble with? |
This is my build file definition: [default.css] I've looked through the code a bit, and maybe you could do something like this to add the correct asset folder to the retuned path. asset_compress/libs/asset_scanner.php:108 protected function _resolveTheme($file) {
$file = preg_replace(self::THEME_PATTERN, '', $file);
$ext = pathinfo($file, PATHINFO_EXTENSION);
switch ( $ext ) {
case 'css':
$folder = 'css' . DS;
break;
case 'js':
$folder = 'js' . DS;
break;
default:
$folder = null;
break;
}
return App::themePath($this->_theme) . 'webroot' . DS . $folder . $file;
} |
Or you could put the path in the build file definition? Adding it in when resolving assets means there is a chance for duplicate paths. |
Yeah that would be better, thanks. |
I've been trying to use the new asset compress theme support, but I've stumbled upon some weird behavior.
When building a theme file and your theme structure is as follows:
themed/
----mytheme/
--------webroot/
------------css/
------------img/
------------js/
You will get errors saying some files could not be found. This is because the scanner will look for the files in webroot.
For the time being I've created a stylesheet and js file in the theme's webroot which will import / require my theme assets.
Maybe this was intended, I don't know. Just thought I should report it.
The text was updated successfully, but these errors were encountered: