config view

This commit is contained in:
2023-11-06 12:52:04 +01:00
parent ea38bdd02f
commit 8668a0438e
5 changed files with 138 additions and 25 deletions
+50
View File
@@ -3,6 +3,56 @@
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
twig.config:
# Twig debugging:
#
# When debugging is enabled:
# - The markup of each Twig template is surrounded by HTML comments that
# contain theming information, such as template file name suggestions.
# - Note that this debugging markup will cause automated tests that directly
# check rendered HTML to fail. When running automated tests, 'debug'
# should be set to FALSE.
# - The dump() function can be used in Twig templates to output information
# about template variables.
# - Twig templates are automatically recompiled whenever the source code
# changes (see auto_reload below).
#
# For more information about debugging Twig templates, see
# https://www.drupal.org/node/1906392.
#
# Not recommended in production environments
# @default false
debug: true
# Twig auto-reload:
#
# Automatically recompile Twig templates whenever the source code changes.
# If you don't provide a value for auto_reload, it will be determined
# based on the value of debug.
#
# Not recommended in production environments
# @default null
auto_reload: null
# Twig cache:
#
# By default, Twig templates will be compiled and stored in the filesystem
# to increase performance. Disabling the Twig cache will recompile the
# templates from source each time they are used. In most cases the
# auto_reload setting above should be enabled rather than disabling the
# Twig cache.
#
# Not recommended in production environments
# @default true
cache: false
# Cacheability debugging:
#
# Responses with cacheability metadata (CacheableResponseInterface instances)
# get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers.
#
# For more information about debugging cacheable responses, see
# https://www.drupal.org/developing/api/8/response/cacheable-response-interface
#
# Not recommended in production environments
# @default false
http.response.debug_cacheability_headers: true
services:
cache.backend.null:
+12 -12
View File
@@ -18,19 +18,19 @@ function rorschach_preprocess_html(&$variables) {
}
function rorschach_preprocess_node(&$variables){
$node = &$variables['node'];
$variables['attributes']['class'][] = 'node-type-' . $node->gettype();
if($node->gettype() == "actualite") {
$actu_type = $node->get('field_actu_type')->getString();
$variables['attributes']['class'][] = 'actu-type-' . $actu_type;
}
if($node->gettype() == "offre_de_service") {
$type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
$variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
}
// function rorschach_preprocess_node(&$variables){
// $node = &$variables['node'];
// $variables['attributes']['class'][] = 'node-type-' . $node->gettype();
// if($node->gettype() == "actualite") {
// $actu_type = $node->get('field_actu_type')->getString();
// $variables['attributes']['class'][] = 'actu-type-' . $actu_type;
// }
// if($node->gettype() == "offre_de_service") {
// $type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
// $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
// }
}
// }
function rorschach_preprocess_field(&$variables) {
$node = \Drupal::routeMatch()->getParameter('node');
@@ -0,0 +1,23 @@
{#
/**
* @file
* Default theme implementation for a single node in a printer-friendly outline.
*
* Available variables:
* - node: Fully loaded node.
* - depth: Depth of the current node inside the outline.
* - title: Node title.
* - content: Node content.
* - children: All the child nodes recursively rendered through this file.
*
* @see template_preprocess_book_node_export_html()
*
* @ingroup themeable
*/
#}
<article>
<h1>{{ title }}</h1>
{{ depth }}
{{ content }}
{{ children }}
</article>
@@ -0,0 +1,39 @@
{#
/**
* @file
* Default theme implementation for the node title field.
*
* This is an override of field.html.twig for the node title field. See that
* template for documentation about its details and overrides.
*
* Available variables:
* - attributes: HTML attributes for the containing span element.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
* - is_inline: If false, display an ordinary field.
* If true, display an inline format, suitable for inside elements such as
* <span>, <h2> and so on.
*
* @see field.html.twig
* @see node_preprocess_field__node()
*
* @ingroup themeable
*
* @todo Delete as part of https://www.drupal.org/node/3015623
*/
#}
{% if not is_inline %}
{% include "field.html.twig" %}
{% else %}
<span{{ attributes }}>
{%- for item in items -%}
{{ item.content }}
{%- endfor -%}
</span>
{% endif %}