furioussnail Posted August 22, 2018 Report Posted August 22, 2018 Hello. For some reason Blesta adds theme.css?dir= as an asset dependency. What is the reason behind this? This make the resource difficult to cache. Can it be fixed? Thank you. Quote
0 Paul Posted August 22, 2018 Report Posted August 22, 2018 theme.css is what sets the color theme based on the theme selected and defined under Settings > Company > Look and Feel > Themes. I don't know if that answers your question, but without theme.css Blesta will revert to default colors. activa 1 Quote
0 furioussnail Posted August 22, 2018 Author Report Posted August 22, 2018 I undestand the purpose of the theme.css file. The problem is caused by the "?dir=" query string added to the file: <link href="/admin/theme/theme.css?dir=" rel="stylesheet" type="text/css" media="screen" /> I think the href should point to the file without "?dir=". Thank you. Quote
0 Paul Posted August 23, 2018 Report Posted August 23, 2018 6 hours ago, furioussnail said: I undestand the purpose of the theme.css file. The problem is caused by the "?dir=" query string added to the file: <link href="/admin/theme/theme.css?dir=" rel="stylesheet" type="text/css" media="screen" /> I think the href should point to the file without "?dir=". Thank you. I don't know the reason ?dir= is appended to the file. I'll bring it up with the team. What kind of caching are you doing, and how is the resource interpreted? Does it assume that it's a dynamic resource, and does not cache it, or? If it was cached, a new theme would not be picked up until the cache expires. For the admin area, this is a problem if you have multiple companies and are switching between them. The URL would stay the same, but the company & theme would change. Perhaps the file name should be THEMENAME.css Quote
0 Nelsa Posted August 23, 2018 Report Posted August 23, 2018 That is used when custom theme is set to load correct css...it is link generated by PHP, .when you use default theme then theme.css or theme.css?dir= will not cause any difference but if you switch to the custom theme than without dir= it will load default theme ... You can find it in structure.pdt // Theme CSS if (isset($theme_css)) { ?> <link href="<?php $this->Html->_($theme_css);?>" rel="stylesheet" type="text/css" media="screen" /> Quote
0 furioussnail Posted August 23, 2018 Author Report Posted August 23, 2018 17 hours ago, Paul said: I don't know the reason ?dir= is appended to the file. I'll bring it up with the team. What kind of caching are you doing, and how is the resource interpreted? Does it assume that it's a dynamic resource, and does not cache it, or? If it was cached, a new theme would not be picked up until the cache expires. For the admin area, this is a problem if you have multiple companies and are switching between them. The URL would stay the same, but the company & theme would change. Perhaps the file name should be THEMENAME.css Yes, I think the theme should be set to theme.css, or custom-theme.css. I don't think web browsers understand the ?dev= part of that query. Quote
0 Blesta Addons Posted August 24, 2018 Report Posted August 24, 2018 On 8/23/2018 at 6:40 AM, Paul said: I don't know the reason ?dir= is appended to the file. I'll bring it up with the team from the code it appear that if the 'dir' is set in the url then system fetch the dir directory to retrieve theme.css from it. and i don't find in any part in blesta where to set this dir?!!! maybe it was added for a future use ! but now it has no effect at all . Quote
Question
furioussnail
Hello.
For some reason Blesta adds theme.css?dir= as an asset dependency. What is the reason behind this? This make the resource difficult to cache. Can it be fixed?
Thank you.
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.