I know that you can customize nodes by type using node-type-name, but is there a way to do the same thing for teasers?
I've got content types like news, reviews, previews, etc... and i want to set different backgrounds for each of their teasers so they can be more easily distinguished (and for styling purpose).
Something like news with red teaser background, reviews with blue teaser background, previews with green teaser background (this being just an example).

I'd be grateful if someone could help me with this (css or code).

Comments

marian_n’s picture

Any idea at least on how i can identify the teaser's node type, or how i can distinguish between teasers belonging to different type of nodes/content so that i could try to code something?

avpaderno’s picture

Component: drupal.css » markup
jacine’s picture

Status: Active » Fixed

@marian_n you can use a CSS selector like this if you don't need to worry about IE6 support:

.node-type.teaser { ... }

Otherwise, you can also your own class in the node.tpl.php template file, by adding this code to the DIV.

if ($page == 0) { print ' node-teaser-' . $type; }

That would allow you to use:

.node-teaser-news { ... }

Status: Fixed » Closed (fixed)
Issue tags: -custom teaser

Automatically closed -- issue fixed for 2 weeks with no activity.