désactive js actus caroussel pour accès contenu
This commit is contained in:
parent
91f248bfd7
commit
7176f2d82d
File diff suppressed because one or more lines are too long
@ -1912,6 +1912,9 @@ body {
|
||||
transform: scale(1.3);
|
||||
}
|
||||
}
|
||||
#home .content_container #block-quartiers-de-demain-titredepage {
|
||||
display: none;
|
||||
}
|
||||
#home .paragraph--type--static-parts {
|
||||
padding-top: 4rem;
|
||||
padding-bottom: 2rem;
|
||||
|
@ -357,33 +357,33 @@
|
||||
|
||||
/////////////////// caracteres body actus/////////////////////////
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Nombre maximum de caractères à afficher
|
||||
const maxChars = 140; // Ajustez cette valeur selon vos besoins
|
||||
// document.addEventListener('DOMContentLoaded', function() {
|
||||
// // Nombre maximum de caractères à afficher
|
||||
// const maxChars = 140; // Ajustez cette valeur selon vos besoins
|
||||
|
||||
document.querySelectorAll('#actus-caroussel .node-type-actualite').forEach(function(node) {
|
||||
let paragraphs = node.querySelectorAll('.field_body p');
|
||||
let fullText = "";
|
||||
// document.querySelectorAll('#actus-caroussel .node-type-actualite').forEach(function(node) {
|
||||
// let paragraphs = node.querySelectorAll('.field_body p');
|
||||
// let fullText = "";
|
||||
|
||||
// Concaténer tous les paragraphes
|
||||
paragraphs.forEach(p => fullText += p.textContent.trim() + " ");
|
||||
fullText = fullText.trim();
|
||||
// // Concaténer tous les paragraphes
|
||||
// paragraphs.forEach(p => fullText += p.textContent.trim() + " ");
|
||||
// fullText = fullText.trim();
|
||||
|
||||
// Vérifier si le texte dépasse la limite
|
||||
if (fullText.length > maxChars) {
|
||||
let truncatedText = fullText.slice(0, maxChars) + '...';
|
||||
// // Vérifier si le texte dépasse la limite
|
||||
// if (fullText.length > maxChars) {
|
||||
// let truncatedText = fullText.slice(0, maxChars) + '...';
|
||||
|
||||
// Vider tout le contenu et insérer seulement le texte tronqué
|
||||
let firstParagraph = paragraphs[0];
|
||||
firstParagraph.textContent = truncatedText;
|
||||
// // Vider tout le contenu et insérer seulement le texte tronqué
|
||||
// let firstParagraph = paragraphs[0];
|
||||
// firstParagraph.textContent = truncatedText;
|
||||
|
||||
// Masquer les autres paragraphes
|
||||
for (let i = 1; i < paragraphs.length; i++) {
|
||||
paragraphs[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// // Masquer les autres paragraphes
|
||||
// for (let i = 1; i < paragraphs.length; i++) {
|
||||
// paragraphs[i].style.display = "none";
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
}
|
||||
.content_container{
|
||||
#block-quartiers-de-demain-titredepage{
|
||||
// display: none;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.paragraph--type--static-parts{
|
||||
|
@ -92,13 +92,19 @@
|
||||
{# {{ content }} #}
|
||||
{# </div> #}
|
||||
{% block content %}
|
||||
|
||||
|
||||
<div class="infos-actu">
|
||||
{{content.field_type_d_actualite}}
|
||||
{{content.field_date}}
|
||||
</div>
|
||||
<h2{{ title_attributes }}>
|
||||
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
|
||||
</h2>
|
||||
{{content.body}}
|
||||
{{content.field_liens}}
|
||||
{{content.field_images}}
|
||||
{{content.field_title}}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user