Can't combine a PHP-generated CSS file with AssetList (5.7)
Permalink
Hi all
I'm using SASS to build my theme, the output of which is combined and compressed by scssphp. The URL of the resulting file is something like /application/themes/mytheme/scss/styles.min.php, which reads another cached css file.
I'm trying to register this asset so it's included in c5's combined CSS file, like this:
page_theme.php
When I turn CSS and JS caching on it outputs the correct markup:
...but the output of that file isn't included in the cached file. If I navigate to /application/themes/mytheme/scss/styles.min.php I see the correct CSS, but it just isn't included. Can anyone help? I'm assuming it's something to do with the fact it's a PHP file rather than a CSS file, but since the headers are all correct to emulate a CSS file I don't know what the problem is.
Any help would be appreciated.
I'm using SASS to build my theme, the output of which is combined and compressed by scssphp. The URL of the resulting file is something like /application/themes/mytheme/scss/styles.min.php, which reads another cached css file.
I'm trying to register this asset so it's included in c5's combined CSS file, like this:
page_theme.php
public function registerAssets() { $al = \Concrete\Core\Asset\AssetList::getInstance(); $al->register('css', 'themestyles', 'themes/mytheme/scss/styles.min.php'); $this->requireAsset('css', 'themestyles'); }
When I turn CSS and JS caching on it outputs the correct markup:
<link href="/site/application/files/cache/css/329245284a36a2b86196038c4a0c4fe07572d2df.css" rel="stylesheet" type="text/css" media="all" data-source="/site/application/themes/mytheme/scss/styles.min.php /site/concrete/css/app.css /site/concrete/css/jquery-ui.css">
...but the output of that file isn't included in the cached file. If I navigate to /application/themes/mytheme/scss/styles.min.php I see the correct CSS, but it just isn't included. Can anyone help? I'm assuming it's something to do with the fact it's a PHP file rather than a CSS file, but since the headers are all correct to emulate a CSS file I don't know what the problem is.
Any help would be appreciated.