Hi, I would like to add a color to a specific content type so when creating a new post under that content type, the node will have a different color than all other nodes anywhere on the site

OR, instead of a color, how can I add a background image to that content type?

I have been reading for a couple of days to resolve this issue. Problem is I don't know anything about php, html or css. Is there an easy way?

Thanks

Comments

nilashis’s picture

I think what you really mean is - how do you display a certain content type (node) in a certain color. Drupal does not store theming information (like font color) together with node data, such theming details are added/rendered in the theme layer.

Anyhow, you solution may be to add a custom css file and name it something like "node--mycontenttype.css" where "mycontenttype" is the machine readable name of your specific content type. In this css file, you can make all text of whatever color you want, or add a background image.

How to change font color or add background image? Just google for this, for example background command: http://www.w3schools.com/css/css_background.asp

In general, http://www.w3schools.com/css should provide all css code samples.

Hope this helps.

Mo Omar’s picture

Sorry but I am a newbie. .
Can you or anybody elaborate more?
Should I copy an already-existed file and add to it the new code? or create a file from scratch, and if so, what else should I put in the code?

Where to put the css file?

I swear I tried this method but it did not work for some reason. .

I don't know if this could help but I am using acquia marina theme.
Thanks nilashis

I am an accountant and I love drupal. I build websites for my projects

Anks’s picture

Hi moh

You can do that by css also.. Just find your node-type class from body tag of your theme , and if not then put node-type as a class on body tag.

So by selecting particular node-type class you can change color or background-image or whatever for the particular content type.

Hope this will help you.

Ankit Hinglajia

Mo Omar’s picture

These are very useful information for a newbie like myself. I will have to look into these options but I may have more questions since I never played around css before.

Thank you

I am an accountant and I love drupal. I build websites for my projects