drowl_paragraphs_bs-1.x-dev/modules/drowl_paragraphs_bs_type_markup/drowl_paragraphs_bs_type_markup.module
modules/drowl_paragraphs_bs_type_markup/drowl_paragraphs_bs_type_markup.module
<?php
/**
* @file
* Module file.
*/
/**
* Implements hook_preprocess_paragraph__TYPE().
*/
function drowl_paragraphs_bs_type_markup_preprocess_paragraph__markup(&$variables) {
// To ensure the markup is rendered even with empty region check,
// we add the empty-check-workaround. Typically markup like Javascript
// might not have visual output, but should be rendered anyway!
if (!empty($variables['content']['field_markup'][0])) {
// Create #suffix array key, if it doesn't exist:
if (!isset($variables['content']['field_markup'][0]['#suffix'])) {
$variables['content']['field_markup'][0]['#suffix'] = '';
}
// Append the empty-check-workaround:
$variables['content']['field_markup'][0]['#suffix'] .= '<span class="empty-check-workaround element-hidden"> </span>';
}
}
