DS Layout Attributes
Categories
Component ID
2226833
Component name
DS Layout Attributes
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Component created
Component changed
Component body
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.

