Hi there,

I've created a quick News and Events segment on my Drupal website. Firstly I created two new content types for both 'News' and 'Events' posts, and then aggregated the 3 most recent News and Event posts on the front page (As well as there being a full view page of all News/Events and not just 3 items).

One thing i'd like to do is have a newspaper image for a news item, and a calendar image for an event item. Somehow I need to uniquely identify each list item on the front page to say if it is a news or event item - and preferably by adding styles such as .newsitem and .eventitem to them.

Any ideas of the best way to achieve this?

Thanks in advance!

Frank

Comments

mkalbere’s picture

Several way , but the simpliest is in your themes/YOURTHEME/node.tpl.php
add this around your code

print $node->type; ">