Active
Project:
Custom CSS and JavaScript files
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2009 at 07:48 UTC
Updated:
5 Oct 2009 at 01:42 UTC
Hi davebv,
What you have there is pretty good already. Now, to avoid loading many CSS in each page, would you consider adding some selection support based on node types and on individual pages?
I think we could achieve that with a very simple scheme that adds a directory tree under the existing folder.
customercssjs/css/node-type/extra-css-for-node-type*.css
customercssjs/css/node-id/extra-css-for-page-id*.css
If the folder exists and it matches the current node type, and node identifier, then include those extra CSS.
It seems to me that this scheme would not break your existing behavior (unless you read all the files, including those in sub-folders already?!)
Please, let me know your thoughts.
Thank you.
Alexis Wilke
Comments
Comment #1
davebv commentedHi,
Thanks for the suggestion, that would be a good scheme to add styles and js based on content type or id.
What do you think about having all the files listed in admin pages and then select where to include? (Just thinking out loud as an alternative)
Comment #2
AlexisWilke commentedDave,
Well... if you have half a million nodes, that would be a large page... 8-)
The way I mentioned it would be automatic and thus maybe a bit hard for some users to know where things are going. Although, for the CSS files, it is already like that with all those .tpl name which I still don't master.
I have a website (Scam Page of Alexis) where some of the pages should keep the CSS from the original message. (luckily, not that often!) So whenever I edit a page, I'd like to specify the CSS for that one page. The best would actually be to have an extra box where I can just paste the CSS. Then that CSS is added to the output page (possibly just inline would work for me! and it could be before or after the theme, no matter since the node data will include a special DIV with an ID which I can use for the theming.)
Now, it would be just fine and very simple for me to create a folder for that node and voilà!
Thank you.
Alexis