How to display CCK fields inline??

do i use what variable name?

CommentFileSizeAuthor
#13 sample_edit_cck_inline.png5.11 KBdrupalnesia

Comments

bsherwood’s picture

Status: Active » Fixed

You can access the 'display fields' tab at "admin/content/node-type/{machine-readable content type name}/display"

There you can select the label as inline.

chasz’s picture

Priority: Normal » Critical
Status: Fixed » Active

erhhmmm i have only started on drupal 5 days ago LOL

I have a new field with the machine name "field_teaser"

how is that displayed inline?? and how can i manipulate it??

i am guessing that each field is listed vertically by the order in the submit form?

bsherwood’s picture

Status: Active » Fixed

First off congrats with using Drupal. Secondly, A piece of advice, people on drupal.org won't take you to seriously if you set issues like this to critical. We use that priority for major bugs.

When you go to content types, click edit for the fields you want to make inline. Like:

Content Types > select edit page

Once there you will see a tab on the top that says 'Display fields' (CCK has to be installed). Click it.

You will get a page with a bunch of drop down boxes. you are concerned with the 'label' field.

Under label you have the options of 'default' , 'above' or 'inline'. Select inline then save.

Voila.

If you need more customization check out the module 'content templates (contemplates)' or search for how to them a CCK field.

Just remember that Drupal 5 has the most module options at the moment, drupal 6 is still catching up. So if you need a highly customized site, go with D5. If you want to wait a little bit go with D6. Also note that some modules are not making the transition from D5 to D6. Just keep that in mind when you are selecting modules to use.

chasz’s picture

Priority: Critical » Normal
Status: Fixed » Active

LOL sorry i thought u would have filtered by bugs or support for the urgency of the matter :D

but this labelling isnt what am looking for.

when u enter the data for the cck field, its stored in the variable, inserted and recalled from the database.

what is that variable and can i insert it into the body field? contemplate can give me the variable but is there an eaasier way?

the most important thing i need to know if these cck_fields can be inserted into the body field or another field?

bsherwood’s picture

Sorry, I never had to dig into the variable names yet, contemplate has satified my basic need to quickly theme a field.

http://drupal.org/node/98253 might help you find those variables.

yched’s picture

Status: Active » Fixed

chasz, you cant insert cck values into the body field when editing the node.

Contemplate is your best choice. You can also wrap up your sleeves and learn about writing your node templates yourself.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

tmai’s picture

hello
The above does not work for 6.x
Thuan

JaredAM’s picture

+1 on the display:inline not working in 6.x

In the meantime, you can style it yourself:

#edit-field-NAME-value-wrapper label,
#edit-field-NAME2-0-value-wrapper label,
#edit-field-NAME2-0-value.form-text,
etc
{
display:inline;
}
zdean’s picture

Status: Closed (fixed) » Active

it is not working for me either. I've set up a text field with widget type "select list."

cwebster’s picture

This might be a better addition to the CSS. It solved the problem for me, at least.

Add the following to your theme's stylesheet (usually /sites/all/themes/[your-theme]/style.css):

.field .field-label-inline, .field .field-label-inline-first { /*Allows labels to be displayed inline*/
  float:left;
}
markus_petrux’s picture

Status: Active » Fixed

In the "Display fields" screen of the content type you can select "Inline" on the "Label" column of any field. You can further adjust this using CSS. If that's not enough, then I think you can tweak content-field.tpl.php to suit your needs.

If you need to display a field outside the node view, then you can also use content_view_field() or content_format(), both located in content.module.

To theme fields you can also override theme functions, or you can implement additional field formatters for any field.

I think CCK offers a lot of options that you can use to suit your needs.

Install the advanced_help module that will allow you to see valuable information on these matters about CCK, and other modules such as views, etc.

drupalnesia’s picture

StatusFileSize
new5.11 KB

Only local images are allowed.To make CCK inline when editing node is simple, you can use contemplate module or just enter this code to your styles.css:

.form-item label {
font-size: 1em;
color: #222;
float: left;
width: 120px;
}

Adjust the width to meet your label width.

to make this CSS only affect to node-form:

#node-form .form-item label {
font-size: 1em;
color: #222;
float: left;
width: 120px;
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.