I just created a CCK field (a text area) called About to the story content type. Now I want to display the content of the field in a box above the body. I set the display option to show the title over the content of the text area.

Now I just want to have the title (About) and the content of the text area in a boxed off area. So that means I'd add a border to the containing element. How do I do theming of this sort.

Thanks a ton.

Varun

Comments

archi’s picture

Hi,

Gave css to that field id/class which you wanted to give border.

whatever your class or id is eg : -

.field-type-text {
border: 1px solid #000;
padding: 0.4em;
}

vamega’s picture

Yeh.

I understand that I'd have to use CSS to create the border. The question is where I should insert the CSS, and how I can set the id of the CCK field.

I've been reading into this, and saw a module called views. Is that going to be of any use in styling this field?

Thanks for your time.

Varun

archi’s picture

Hi,

I think this should help you.
http://drupal.org/node/153465

vamega’s picture

Thanks that should work. The style.css you mention is the one in the theme folder right?
Is there any way that I could do the same by modifying some css file in the CCK folder.
That way it would work for all themes, irrespective of the theme.

Cheers, and thanks once more.

Varun

jainrutgers’s picture

Try putting that code in default.css file

The location of file would be

modules/system/default.css

Note: Its not recommended to change the core things. You will loose this functionality when you upgrade the core version. Or just make sure you copy the same code in the upgraded version of core default.css file

Chetan
http://www.cjain.com

archi’s picture

Hi,

Better is to do that modification in your themes style.css,
you can do that in your cck folder also as jainrutgers mentioned.
But it's a good habit to changed your css without touching default css files.

vamega’s picture

So what I think everyone is getting at is that I create a new css file in the CCK folder where I put in all my custom css. Then import this css file from the older file. That way every time I need to upgrade all i need to do is rewrite the import line.

Is this right, or is there a better way of doing this?

Thanks.

Varun

archi’s picture

Hi,

There are 2 options to do this thing.

1) Add a css file in your themes folder.
2) Create a custom module and using drupal_add_css add custom css file.

vamega’s picture

Thanks. I decided to develop a module that adds the required CSS. Hopefully I'll be able to make it generic enough to contribute back here.

Thanks a lot. Your help is greatly appreciated.

Varun

paul o brien’s picture

i have toplist.css in the garland directory.

in node-toplist.tps.php, also in the garland directory, i have:
link href="toplist.css" rel="stylesheet" type="text/css" /

but changes to toplist.css are not seen in the node.

what am i doing wrong?

thanks.

paul