Commit 542980f0 authored by catch's avatar catch

Issue #2329759 by Sutharsan: Move container classes from preprocess to templates.

parent 74e0d638
......@@ -1523,6 +1523,7 @@ function theme_indentation($variables) {
* Properties used: #id, #attributes, #children.
*/
function template_preprocess_container(&$variables) {
$variables['has_parent'] = FALSE;
$element = $variables['element'];
// Ensure #attributes is set.
$element += array('#attributes' => array());
......@@ -1533,8 +1534,7 @@ function template_preprocess_container(&$variables) {
if (!isset($element['#attributes']['id'])) {
$element['#attributes']['id'] = $element['#id'];
}
// Add the 'form-wrapper' class.
$element['#attributes']['class'][] = 'form-wrapper';
$variables['has_parent'] = TRUE;
}
$variables['children'] = $element['#children'];
......
......@@ -9,10 +9,12 @@
* Available variables:
* - attributes: HTML attributes for the containing element.
* - children: The rendered child elements of the container.
* - has_parent: A flag to indicate that the container has one or more parent
containers.
*
* @see template_preprocess_container()
*
* @ingroup themeable
*/
#}
<div{{ attributes }}>{{ children }}</div>
<div{{ attributes.addClass(has_parent ? 'form-wrapper') }}>{{ children }}</div>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment