I needed a way to allow per-node CSS editing in the admin screen and have modified this module to meet that need.
I have modified this module to include the following features:
A fieldset and checkbox is added to admin/content/node-type/*
Content types with this checkbox marked will get a CSS editing fieldset in node/add/[content-type] and node/[nid]/edit
The css fieldset includes a textarea to edit CSS and the media dropdown and preprocessing checkbox. When submitted, if there is CSS code, a new CSS rule is created with an assumed name of node-[nid] and an assumed rule of "Add on only the listed pages" and "node/[nid]"
Will probably do a bit of refactoring later, but right now it works and is ready for feedback
Also attached is a screenshot of the node/edit screen with this in action
Comment | File | Size | Author |
---|---|---|---|
node-edit-css-injector.png | 7.39 KB | Dustin Currie | |
css_injector.module.patch | 7.13 KB | Dustin Currie | |
css_injector.install.patch | 1.44 KB | Dustin Currie | |
Comments
Comment #1
that0n3guy CreditAttribution: that0n3guy commentedThis is pretty sweet. I've been looking for something similar. I'll be testing this out very shortly.
EDIT: I just noticed how old this post was. Does no one else want this? This is a great usability thing for things like landing pages.
Comment #2
klonosI'll give this a go soon and see if it still works.
@that0n3guy & Dustin Currie: Are you still using this & does it still work? If so, in what core version? Thanx in advance for your feedback.
@that0n3guy:
...well, at least one + me considering it now ;)
...still I have my doubts.
Comment #3
DamienMcKennaWhy not use Code per Node instead, that's what it's designed for?
Comment #4
kreynen CreditAttribution: kreynen commented@DamienMcKenna is correct. CPN is a better fit for that use case.