By vamega on
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
Theme CCK Field
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;
}
I'm sorry, I didn't really follow that
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
try this link
Hi,
I think this should help you.
http://drupal.org/node/153465
Thanks for that.
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
Try putting that code in
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
theme css
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.
So that would mean..
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
2 ways to do it
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.
Thanks. I'm going with the module.
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
can't link .css to content type
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