Active
Project:
Code per Node
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Jun 2011 at 10:40 UTC
Updated:
28 Nov 2011 at 09:30 UTC
You might want to review http://drupal.org/project/cpn as it allows you to add custom JS and CSS for each block, node and content type.
Comments
Comment #1
weblitz commentedI've tried code per node module; it allows to put css in each block, but it doesn't seem to have an interesting functionality of Css Block Editor: this module has a token (@idblock) which can be used to get automatically the id of the block. The difference is:
CODE PER NODE css:
#block_specific_id ( I have to find by myself looking at the html source) {}
CSS BLOCK EDITOR css:
@idblock {which is always the block id}
Comment #2
robloachWe could easily add that feature to Code Per Node ;-) . I could help you with that if you want as I'm one of the maintainers behind the module.... We just don't want to end up with duplicate modules around, as it's one of the complaints that newcomers have when they check out Drupal. Thanks!
Comment #3
weblitz commentedok then
I think the feature could be interesting because the code generated for a block can be copied to another block without searching for the new id
thanks
miki
Comment #4
robloachLet's move this over to that project then :-) .... Load in given tokens which the CSS and JS would find helpful. Like having @idblock load in for blocks, or @idnode for the node's ID.
Comment #5
joelstein commentedInstead of using the @ symbol, which has a meaning in CSS, I recommend that we use the standard token format, or something similar.
Comment #6
BenK commentedSubscribing
Comment #7
efc84 commentedHi,
Is it possible to give each individual block a custom class for the heading?
Currently i'm using Bartik and every block automatically receives a 'h2' heading and that means if i change the 'h2' colour it changes every heading to the same colour, what i want to do is change each heading into different colors, is this possible?
eg
h2.search-form-block {
color: white;
}
h2.recent-content-block {
color:blue;
}
Comment #8
joelstein commented@efc84: I don't think your question has anything to do with Code per Node. Check out Block Class, which does what you're wanting.
Comment #9
efc84 commentedThank you joelstein