désactive js actus caroussel pour accès contenu

This commit is contained in:
Ouidade Soussi Chiadmi 2025-03-03 15:48:39 +01:00
parent 91f248bfd7
commit 7176f2d82d
5 changed files with 33 additions and 24 deletions

File diff suppressed because one or more lines are too long

View File

@ -1912,6 +1912,9 @@ body {
transform: scale(1.3); transform: scale(1.3);
} }
} }
#home .content_container #block-quartiers-de-demain-titredepage {
display: none;
}
#home .paragraph--type--static-parts { #home .paragraph--type--static-parts {
padding-top: 4rem; padding-top: 4rem;
padding-bottom: 2rem; padding-bottom: 2rem;

View File

@ -357,33 +357,33 @@
/////////////////// caracteres body actus///////////////////////// /////////////////// caracteres body actus/////////////////////////
document.addEventListener('DOMContentLoaded', function() { // document.addEventListener('DOMContentLoaded', function() {
// Nombre maximum de caractères à afficher // // Nombre maximum de caractères à afficher
const maxChars = 140; // Ajustez cette valeur selon vos besoins // const maxChars = 140; // Ajustez cette valeur selon vos besoins
document.querySelectorAll('#actus-caroussel .node-type-actualite').forEach(function(node) { // document.querySelectorAll('#actus-caroussel .node-type-actualite').forEach(function(node) {
let paragraphs = node.querySelectorAll('.field_body p'); // let paragraphs = node.querySelectorAll('.field_body p');
let fullText = ""; // let fullText = "";
// Concaténer tous les paragraphes // // Concaténer tous les paragraphes
paragraphs.forEach(p => fullText += p.textContent.trim() + " "); // paragraphs.forEach(p => fullText += p.textContent.trim() + " ");
fullText = fullText.trim(); // fullText = fullText.trim();
// Vérifier si le texte dépasse la limite // // Vérifier si le texte dépasse la limite
if (fullText.length > maxChars) { // if (fullText.length > maxChars) {
let truncatedText = fullText.slice(0, maxChars) + '...'; // let truncatedText = fullText.slice(0, maxChars) + '...';
// Vider tout le contenu et insérer seulement le texte tronqué // // Vider tout le contenu et insérer seulement le texte tronqué
let firstParagraph = paragraphs[0]; // let firstParagraph = paragraphs[0];
firstParagraph.textContent = truncatedText; // firstParagraph.textContent = truncatedText;
// Masquer les autres paragraphes // // Masquer les autres paragraphes
for (let i = 1; i < paragraphs.length; i++) { // for (let i = 1; i < paragraphs.length; i++) {
paragraphs[i].style.display = "none"; // paragraphs[i].style.display = "none";
} // }
} // }
}); // });
}); // });

View File

@ -52,7 +52,7 @@
} }
.content_container{ .content_container{
#block-quartiers-de-demain-titredepage{ #block-quartiers-de-demain-titredepage{
// display: none; display: none;
} }
} }
.paragraph--type--static-parts{ .paragraph--type--static-parts{

View File

@ -92,13 +92,19 @@
{# {{ content }} #} {# {{ content }} #}
{# </div> #} {# </div> #}
{% block content %} {% block content %}
<div class="infos-actu"> <div class="infos-actu">
{{content.field_type_d_actualite}} {{content.field_type_d_actualite}}
{{content.field_date}} {{content.field_date}}
</div> </div>
<h2{{ title_attributes }}>
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
</h2>
{{content.body}} {{content.body}}
{{content.field_liens}} {{content.field_liens}}
{{content.field_images}} {{content.field_images}}
{{content.field_title}}
{% endblock %} {% endblock %}