By richard.c.allen2386 on
Hi all, I've been tearing my hair out with this seemingly simple task. Basically I have a cck content type and I am creating a custom add/edit template for it. Everything is working but I can't seem to group multiple inputs on one line. I.E.
city: ______ state: ____ zip:____ . I have tried to create a div wrapping around my form with display: inline but it doesn't seem to work. Here is a copy of my node-content_type-edit.tpl
[code]
$form['title']['#size'] = 20;
$form['field_datasource_organization'][0]['value']['#size'] = 20;
unset($form['body_field']['format']['format']['guidlines']);
print drupal_render($form['title']);
print drupal_render($form['field_datasource_organization']);
print drupal_render($form['body_field']);
print drupal_render($form['field_contact_name']);
print drupal_render($form['field_contact_title']);
print drupal_render($form['field_contact_address1']);
print drupal_render($form['field_contact_address2']);
print drupal_render($form['field_contact_city']);
print drupal_render($form['field_contact_state']);
print drupal_render($form['field_contact_zip']);
//print drupal_render($form);
Comments
hi, there will be
hi,
there will be blocks(divs) inside your drupal rendered form. no template is required. Inside the div blocks, there will be the label and input fields.
What you have to is through CSS, make those small divs inline. putting a wrapper div and making it inline wont work because only that div becomes inline, and all the div inside the wrapper are still blocks.
thanks
PErfect Thanks!
That was exactly what I needed, thanks. For references sake I'm going to put down what I did in case anyone else needs something similar. Adding this css worked like a charm. Reference the div.form-item class (the div.label too if you want the labels to float also) and you can use any css you'd like mine is below.
div.form-item {
float: left;
padding-left: .5em;
padding-bottom: 0;
margin-left: .5em;
margin-bottom: 0;
}