css home & sites pilotes

This commit is contained in:
2024-06-18 23:55:49 +02:00
parent a668919637
commit fa20453ef8
47 changed files with 6244 additions and 220 deletions
+22 -21
View File
@@ -35,32 +35,32 @@ function reha_preprocess_page(&$variables) {
function reha_preprocess_node(&$variables) {
$node = &$variables['node'];
$variables['attributes']['class'][] = 'node-type-' . $node->gettype();
if ($variables['node']->getType() == 'site') {
$fields_to_exclude = [
'field--name-field-image',
];
$filtered_content = [];
$image_field_content = '';
foreach ($variables['content'] as $field_name => $field_content) {
if (!in_array($field_name, $fields_to_exclude)) {
$filtered_content[$field_name] = $field_content;
} else {
$image_field_content = $field_content;
}
}
$variables['filtered_content'] = $filtered_content;
$variables['image_field_content'] = $image_field_content;
}
}
/**
* Prepares variables for block templates.
*
* Default template: block.html.twig.
*
* Prepares the values passed to the theme_block function to be passed
* into a pluggable template engine. Uses block properties to generate a
* series of template file suggestions. If none are found, the default
* block.html.twig is used.
*
* Most themes use their own copy of block.html.twig. The default is located
* inside "core/modules/block/templates/block.html.twig". Look in there for the
* full list of available variables.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the properties of the element.
* Properties used: #block, #configuration, #children, #plugin_id.
*/
//https://www.hashbangcode.com/article/drupal-9-programmatically-creating-and-using-urls-and-links
function reha_preprocess_block(&$variables) {
if ($variables['plugin_id'] === "user_login_block") {
@@ -90,4 +90,5 @@ function reha_preprocess_block(&$variables) {
}
}
}
}