function THEMENAME_preprocess_html(array &$vars): void {
if (
\Drupal::routeMatch()->getRouteName() == 'entity.node.canonical' &&
$node = \Drupal::routeMatch()->getParameter('node')
) {
foreach ($node->get('field_paragraphs') as $item) {
$paragraph = $item->entity;
if ($paragraph->bundle() == 'ad_section' && !$paragraph->get('field_video')->isEmpty()) {
$vars['attributes']['class'][] = 'has-video';
}
}
}
}
.gallery {
display: grid;
gap: 20px;
grid-template-columns: repeat(auto-fit, minmax(250px, max-content));
}
.gallery__item {
width: 300px;
max-width: 100%;
}
// THEMENAME.theme
function THEMENAME_preprocess_node__NODE_ID(array &$vars) {
$webform_build = [
'#type' => 'webform',
'#webform' => 'WEBFORM_ID',
];
$vars['content']['body'][0]['#text'] = str_replace('[webform]', render($webform_build), $vars['content']['body'][0]['#text']);
}
<ul>
<li class="my-row-class">строка 1</li>
<li class="my-row-class">строка 2</li>
<li class="my-row-class">строка ...</li>
</ul>
<ul>
<li class="views-row my-row-class">строка 1</li>
<li class="views-row my-row-class">строка 2</li>
<li class="views-row my-row-class">строка ...</li>
</ul>