Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Step 1. Find out the cck field names you want to theme:
/admin/content/types/fields
For example, I want to define the following two field names:
field_author
field_photo
Step 2. In style.css, at end add:
.field-field-author {
color: blue;
}
.field-field-photo {
float: right;
}
You can also define field type.
For example, I define all my "text" type:
.field-type-text{
font-style: italic;
}
For example, I define all my "image" type:
.field-type-image{
margin-top:1em;
}
Comments
thanks
thanks
Thank you for this valuable
Thank you for this valuable tip! Happy new year!
This Works Great!
Thank you for this information - I have been looking for this solution for the past week and it works great. Nice and neat!
Happy New Year!
Tom Hale
New Day Web Design
www.newdaywebdesign.com
Thank you!
Thank you!
Side by Side
How to set the label side the field?
example :
Name : [-field-]
Email : [-field-]
Thx..
try this css code
I'm use css for this requirement,
this this code, it will make your label and field in comment form for anonymus user will be placed inline
sample for this code i have used in http://www.cipta-mobil.com
Doing this for groups (fieldset)
Anybody now the css command for doing this with a group of fields - so I can theme all the fields in a group at once. Thanks!!
For group_test just go
For group_test just go .group-test
Actually what I'd love is to
Actually what I'd love is to have group_test label replaced with an image...
I can't for the life of me ...
figure out why this wouldn't work. I wanted to style the "padding-left" of two field-types on a given content type called "Project Posts," so I put the following my themes CSS file:
.field-field-describe-video {
padding-left: 0;
}
.field-field-embed-video {
padding-left: 0;
}
NOTHING HAPPENED. I also tried a number of other things to no avail. I'm an amateur with CSS, so maybe there is an obvious mistake. I'd appreciate any advice.
taxonomy
This is a very useful tip, but how about theming taxonomy terms and other static values ?
Thanks bro!
side by side
using function hook_theme in module and send to modulename-form.tpl.php in this we write a css code for
print drupal_render($form['name']);
print drupal_render($form['sub']);
print drupal_render($form['msg']);
print drupal_render($form['mail']);
print drupal_render($form['url']);
print drupal_render($form['submit']);
Not working for me. The class
Not working for me. The class does not appear in the HTML:
FYI, I have created a new content type and added new fields in "Manage Fields".
We are here dealing with cck.
We are here dealing with cck. You are using Profile module. And you are in the edit mode also.
Where to insert the code
I'm new to drupal and I found this instruction to be very simple to follow. However, I still have a couple of questions:
1. Why change the format of the field ID?
the field ID is field_author and in the css you have .field-field-author{}
2. Where to insert this code?
I insert this code into the end of the style.css of my current theme which is the bluemarine but unfortunately, it doesn't work.
Please help.
_
Thanks for putting something so simply - it really helps beginners!