A user reported that problem to me on my Demopage (work in progress) for the Four Seasons Theme
http://fourseasons.forward-media.de/
I enabled the module but mystyle.css (/sites/default/files/customcssjs/css/mystyle.css) is included before style.css (/sites/all/themes/fourseasons/css/style.css).
Four Seasons includes the style.css expicitly via the themes info file
stylesheets[all][] = css/style.css
Is that by design?
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | fix_customcssjs_module.patch | 1.29 KB | flateric |
Comments
Comment #1
davebv commentedI had this "issue" from the beginning. I searched how a module could include its styles and javascript files after everything else but I did not find an easy solution.
Right now it is by design (to make this module simplest as possible). In fact, this is how drupal behaves. But I am trying to make a elegant way to override this and to not brake anything else.
Any help and discussion on how to do this are very welcome.
Comment #2
derjochenmeyer commentedMy module Javascript Aggregator does something that could be useful for you.
It implements hook_preprocess_page() and searches the $scripts variable via a RegEx for certain scripts. You could do the same and extract the custom css and js files from the variable and add them again to the end of the array.
You could take the $styles variable, rearrange the order and return it again directly before the page gets rendered.
Here is the example from Javascript Aggregator.
_javascript_aggregator_minify()does the RegEx thing.Comment #3
davebv commentedI just commited a patch, it shoud be in the next dev build. I tried and seems to work but I do not know if that is the best way to do it.
Please, give a try and post comments if it is working and about the code implementation. Thanks!!
If your feedback is positive, I will make a new release.
Comment #4
davebv commentedI modified latest patch for js files to break with
<scriptinstead of<link. Now everything shoud work as expected.Comment #5
davebv commentedLAtest version (and working one, I hope) is released in 1.5.
Comment #6
davebv commentedI have been using this feature myself and did not find problems. Mark this as fixed, please report any problems you may encounter.
Comment #8
ahansen1 commentedI've recently started using this module and have done so successfully on several themes. However, I've just found that with the Ad Blueprint theme it seems to inject the CSS after this module. Any thoughts on how to address the issue?
Comment #9
ahansen1 commentedComment #10
davebv commentedI do not use that theme, but maybe it inserts css files and modify the registry like this module does.
In the case a theme modify the registry and put the css and js at the end of the registry, nothing can be done from a module (or so I guess)
Comment #11
davebv commentedComment #12
web2 commentedsubscribing
Comment #13
klonosHaving this one as 'won't fix' reflects its status on the link in the module's page. That is kinda confusing so changing it to fixed (...and letting the system auto-close it).
Comment #15
flateric commentedThe patch did not fully work for me (using custom css and js locations). I had to change the regex, patch attached.
Anyway, thanks for the module :)
Comment #16
flateric commentedUpload didn't work?