home presentation, page site

This commit is contained in:
2024-06-23 23:03:46 +02:00
parent 44c9b53c16
commit 3353e208b1
13 changed files with 292 additions and 132 deletions
@@ -41,38 +41,23 @@
<h2{{ title_attributes }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{{ content }}
{% endblock %}
</div>
{# {%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
]
%}
<div{{ attributes.addClass(classes) }}>
{{ title_prefix }}
{% if label %}
<h2{{ title_attributes }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{# Afficher le contenu exclu séparément #}
{# {% if excluded_field_content %}
<div class="excluded-field-content">
{{ excluded_field_content }}
</div>
{% endif %}
{# Afficher le contenu filtré #}
{# <div class="filtered-content">
{% for field_name, field_content in filtered_content %}
{{ field_content }}
<div class="custom-block-content">
{% if content %}
{% set displayed_first_paragraph = false %}
{% for key, item in content %}
{% if item['#markup'] is defined and not displayed_first_paragraph %}
{# Split the content by paragraphs #}
{% set paragraphs = item['#markup']|split('</p>') %}
{# Display the first paragraph only #}
<p>{{ paragraphs[0]|striptags }}</p>
{# Add a "Voir plus" button that links to the full content page #}
<a href="/full-content-page" class="btn btn-primary">Voir plus</a>
{% set displayed_first_paragraph = true %}
{% elseif not displayed_first_paragraph %}
{{ item }}
{% endif %}
{% endfor %}
</div>
{% endblock %}
</div> #}
{% endif %}
</div>
</div>
@@ -0,0 +1,59 @@
{#
/**
* @file
* Default template for the 'plain' address formatter.
*
* Available variables:
* - given_name: Given name.
* - additional_name: Additional name.
* - family_name: Family name.
* - organization: Organization.
* - address_line1: First address line.
* - address_line2: Second address line.
* - postal_code: Postal code.
* - sorting_code: Sorting code.
* - dependent_locality: The dependent locality.
* - dependent_locality.code: Dependent locality code.
* - dependent_locality.name: Dependent locality name.
* - locality: The locality subdivision.
* - locality.code: Locality code.
* - locality.name: Locality name.
* - administrative_area: The administrative area subdivision.
* - administrative_area.code: Administrative area code.
* - administrative_area.name: Administrative area name.
* - country: The country.
* - country.code: Country code.
* - country.name: Country name.
* - address: An object that implements \Drupal\address\AddressInterface
* representing the address to be rendered. Only public methods can be used.
* - view_mode: View mode of the entity being rendered that this address field
* is attached to. For example, "teaser" or "full".
*
* if a subdivision (dependent_locality, locality, administrative_area) was
* entered, the array will always have a code. If it's a predefined subdivision,
* it will also have a name. The code is always preferred.
*
* @ingroup themeable
*/
#}
<p class="address" translate="no">
{% if given_name or family_name %}
<span class=""> {{ given_name }} {{ family_name }} </span><br>
{% endif %}
{% if organization %}
<span class="">{{ organization }}</span><br>
{% endif %}
{% if address_line1 %}
<span class=""> {{ address_line1 }} </span><br>
{% endif %}
{% if address_line2 %}
<span class="">{{ address_line2 }} </span><br>
{% endif %}
{% if dependent_locality.code %}
<span class="locality"> {{ dependent_locality.code }} </span><br>
{% endif %}
{% if locality.code or postal_code or administrative_area.code %}
<span class="postal-code"> {{ locality.code }} {{ postal_code }} {{ administrative_area.code }} </span><br>
{% endif %}
<span class="country">{{ country.name }}</span>
</p>
@@ -1,47 +0,0 @@
{#
/**
* @file
* Default theme implementation to display a block.
*
* Available variables:
* - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values.
* - label: The configured label for the block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here.
* - in_preview: Whether the plugin is being rendered in preview mode.
* - content: The content of this block.
* - attributes: array of HTML attributes populated by modules, intended to
* be added to the main container tag of this template.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_block()
*
* @ingroup themeable
*/
#}
{%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
]
%}
<div{{ attributes.addClass(classes) }}>
{{ title_prefix }}
{% if label %}
<h2{{ title_attributes }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{{ content }}
{% endblock %}
</div>
@@ -107,6 +107,7 @@
{# Envelopper le titre et tous les autres champs dans une nouvelle div #}
<div class="filtered-content">
<h1>{{ node.label }}</h1>
{% if label and not page %}
<h2{{ title_attributes }}>
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
@@ -45,7 +45,7 @@
* @ingroup themeable
*/
#}
<div class="layout-container">
<div class="layout-container page--home">
<header role="banner">
{{ page.header }}