Is it possible to prevent inserting the link to the CSS file in the header? #1060
-
|
Hello community! The css file However, I don't need this Edit on: 15.11.25 | 17:30 h |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 21 replies
-
|
Beta Was this translation helpful? Give feedback.
-
|
Sorry for the poor description. I'll try again. The css file However, I don't need this Edit: I replaced my first question with this one. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Mark, thanks for your help! I think it's just a matter of my personal preference. It is probably not important for the community. I thought there might be a simple trick to prevent inserting the link to the CSS file in the header. I sometimes create websites without Yellow. Then I have the following folder structure: If I were to work with Yellow's folder structure, I would always have to change the settings (scss file name and path) in my editor (VS Codium with Live SASS compiler). This is particularly annoying when you have to switch between with and without yellow frequently. Therefore, it would be great for me if I could prevent |
Beta Was this translation helpful? Give feedback.
-
|
So, I'm alone in the office today. So I turned up some »Grunge« music and tried to implement the I wrote this extension: It works and the loading time has remained the same. Even though it's fast, I'm not sure I like this solution that much. I think a smart solution within |
Beta Was this translation helpful? Give feedback.
-
|
Thank you very much! Alternative 1 would be great! I don't know how alternative 4 would work. 😬 Yesterday, I had another idea. If there is a folder ( I tested it with the following code in Line 3340 (Return page extra data, HTML encoded) |
Beta Was this translation helpful? Give feedback.
-
|
The latest API has an event handler <?php
// Enumeratetheme extension, experimental
class YellowEnumeratetheme {
const VERSION = "0.9.2";
public $yellow; // access to API
// Handle initialisation
public function onLoad($yellow) {
$this->yellow = $yellow;
}
// Handle enumeration
public function onEnumerate($action, $context) {
$output = null;
if ($action=="theme") {
$path = $this->yellow->system->get("coreThemeDirectory");
$output = $this->yellow->toolbox->getDirectoryEntries($path, "/.*/", false, true, false);
}
return $output;
}
// Handle page extra data
public function onParsePageExtra($page, $name) {
$output = null;
if ($name=="header") {
$theme = $this->yellow->lookup->normaliseName($page->get("theme"));
$assetLocation = $this->yellow->system->get("coreServerBase").$this->yellow->system->get("coreAssetLocation");
$fileNameTheme = $this->yellow->system->get("coreThemeDirectory").$theme."/css/style.min.css";
if (is_file($fileNameTheme)) {
$output = "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"{$assetLocation}{$theme}/css/style.min.css\" />\n";
// Add more assets here, for example JavaScript, preloads, favicons...
}
}
return $output;
}
}Tested with Datenstrom Yellow 0.9. Hope it helps. |
Beta Was this translation helpful? Give feedback.
The latest API has an event handler
onEnumerate()that you can try out. Just keep in mind that this is an experimental feature and it may be changed or removed at anytime. Here is an example extension filesystem/workers/enumeratetheme.php. It tells the core that you want to use non-flattened themes, which do not follow Datenstrom Yellow's normal folder structure, but your very own folder structure. Now you should be able to adjust the software to your way of working.