0

Pretty straightforward question. Is there a way to get the label for a field to appear below the field? The only options within display suite are inline and above.

1

theoretically you should create a custom field template file overriding the default one.

If you're using Display Suite Extra

1) On DS field settings select "Drupal default" as field template

2) Override the field template following the standard drupal suggestions (see below)

Unfortunately this will not work due to a bug: http://drupal.org/node/1885480

Instead if you're not using Display suite, you'll be able to override the field template without any problem.

Override a field template is quite easy:

1) copy the "field.tpl.php" from /modules/field/theme directory and paste it on your theme directory.

2) rename the file following the rules documented on this page: http://drupal.org/node/1089656

3) change the field-???.tpl.php content moving the label below the field content like:

<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
  <div class="field-items"<?php print $content_attributes; ?>>
    <?php foreach ($items as $delta => $item): ?>
      <div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
    <?php endforeach; ?>
  </div>
  <?php if (!$label_hidden): ?>
    <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</div>
  <?php endif; ?>
</div>
| improve this answer | |
0

On Drupal 7, Displaying fields inline can albo be done with the popular Compact Forms module. You select the CSS IDs of the forms on which you wish to perform the change. Here is the admin page:

Compact Forms - Admin screen

Another, less stable option is the In Field Labels module.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.