function theme_ds_regions in Display Suite 6
Same name and namespace in other branches
- 6.3 theme/theme.inc \theme_ds_regions()
- 6.2 theme/theme.inc \theme_ds_regions()
Theme function to render all regions with their content.
Parameters
stdClass $object_display The complete object and display properties.:
string $module The module name.:
Other variables which you can use:
- $region_data['count']: holds the number of fields per region.
2 theme calls to theme_ds_regions()
- ds_render_content in ./
ds.module - Render content for an object.
- views_plugin_ds_fields_view::ds_views_fields_render in views/
views_plugin_ds_fields_view.inc - Render the content for modules not implementing the ds api.
File
- theme/
theme.inc, line 49 - Theming functions for ds.
Code
function theme_ds_regions($object_display, $module) {
$output = '';
foreach ($object_display->themed_regions as $region_name => $region_data) {
$output .= '<div class="' . $module . '-region-' . $region_name;
// The middle region has a wrapper region and some sidebar related classes.
if ($region_name == 'middle') {
$output .= '-wrapper ';
}
if ($region_name == 'header' || $region_name == 'footer') {
$output .= ' clear-block';
}
// Extra classes or inline styles.
if (!empty($region_data['extra_class'])) {
$output .= $region_data['extra_class'];
}
$output .= '" ';
if (isset($region_data['inline_css'])) {
$output .= $region_data['inline_css'];
}
// Close the wrapper for middle if necessary.
if ($region_name == 'middle') {
$output .= '><div class="' . $module . '-region-' . $region_name . '">' . $region_data['content'] . '</div></div>';
}
else {
$output .= '>' . $region_data['content'] . '</div>';
}
}
return $output;
}