Control markup with field templates

This documentation is written for the 7.x-2.x version of Display Suite.

By default Drupal core wraps fields in multiple HTML elements, as e.g., in:

<div class="field field-name-field-size field-type-text field-label-above">
  <div class="field-label">Size:&nbsp;</div>
  <div class="field-items">
    <div class="field-item even">34</div>
  </div>
</div>

Display Suite allows you to override this markup via the user interface by using field templates. This could result in the following markup for the example above:

<div class="label-above">Size:&nbsp;</div>
34    

Enable field templates

To use Display Suite field templates:

  • Enable the sub module Display Suite Extras at Administration > Modules (admin/modules)
  • Go to Administration > Structure > Display Suite and click the secondary tab "Extras" (admin/structure/ds/extras)
  • Check the option "Enable Field templates"
  • Choose a Default Field Template (e.g., "Full reset" to remove all markup from a field)
  • Click "Save configuration"
  • Go to Administration > Structure > Display Suite (admin/structure/ds/layout) and choose "manage display” for the desired entity.
  • Click the cogwheel right of the field that you want to change.

Add fields to a block [D7]

This documentation is written for the 7.x-2.x version of Display Suite.

Display Suite allows you to put certain fields inside a region that will be rendered as a block. This can then be managed via the Drupal core block administration.

Manage the display of search results

This documentation is written for the 7.x-2.x version of Display Suite.

Display Suite can override the way that Drupal's (and Apache solr's) default search results are being displayed. This will be useful if you wanted to include images or file attachments in search results.

Manage view modes

This documentation is written for the 7.x-2.x version of Display Suite.

Drupal core offers by default some view modes (such as "full content", "teaser" or "search result") for entities. Display Suite allows you to create custom view modes that fit your needs, e.g., "Compact teaser", "Almost full content" or "Micro teaser".

Note: In Drupal 6 view modes were called "build modes".

Use custom view mode

  • Enable DS UI module.
  • Go to Administration > Structure > Display Suite > View modes (admin/structure/ds/view_modes)
  • Click "Add a view mode"
  • Enter a label & define to which entities the mode will be made available
  • Click "Save"
  • Go to Administration > Structure > Display Suite (admin/structure/ds)
  • Click "Manage display" for the entity (e.g., "User") whose display you like to change
  • Choose the vertical tab "Custom display settings"
  • Enable the new view modes
  • Click "Save"
  • Flush all caches
  • Choose the custom view mode from the secondary tabs in the top of the page.

You can now start changing the display for the new view mode.

view modes

The custom view modes can be called from within a module.

Add custom fields to a display

This documentation is written for the 7.x-2.x version of Display Suite.

Display Suite allows you to add fields to an entity (comment, node, et cetera). These fields are not Drupal core Field API fields.

To add custom fields go to Administration > Structure > Display Suite > Fields (admin/structure/ds/fields). If this page is not available, please be sure to enable Display Suite UI module and make sure you have a layout selected.

You can add four types of fields: code, dynamic, block and preprocess fields.

For each you need to enter a label and choose the entities that the field will be available for.

Display Suite Extras

This documentation is written for the 7.x-2.x version of Display Suite.

The Display Suite Extras modules offers a number of additional tools for managing the display of content:

Pages

Subscribe with RSS Subscribe to RSS - Display Suite