Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Purpose

Adds support for HTML attributes in Display Suite layout regions.

Also:

  • supports tokens, so you can define attributes based on entity values
  • retrofits this token support to in-built "layout attributes" field

Example use case

Apply a background image from an Image field on your node:
style="background: url([node:your_image_field])"

Getting Started

You can set attributes under the Custom Wrappers fieldset on the Manage Display page for an entity. (see screenshot above)

For each region, your layout template now has access to a variable named "_attributes", for example:
<?php print $ds_content_attributes; ?>

Important: You will need to override the core layout templates to add this, by copying the default template (for example ds-1col.tpl.php) into your theme directory.

Original development sponsored by:
Tandem Digital

Project information