templates/vitrine/articles/article.html.twig line 1

Open in your IDE?
  1. {% extends 'vitrine/layout.html.twig' %}
  2. {% set paramArticle = getCoreToolsList("article") %}
  3. {% block title %}{{ article.shortTitle }}{% endblock title %}
  4. {% block description %}{{ article.shortDescription }}{% endblock description %}
  5. {% block robots %}index,follow{% endblock robots %}
  6. {% block meta_social %}{{ parent() }}{% include "/vitrine/components/socialmedia_articles.html.twig" with { 'social_type':'article','article':article } %}{% endblock meta_social %}
  7. {% block meta %}{{ parent() }}{% if article.author is not null %}{% if article.author is not empty %}<meta name="author" content="{{ article.author }}" />{% endif %}{% endif %}{% endblock meta %}
  8. {% block canonical %}{% include "/vitrine/articles/components/canonical.html.twig" with {'article':article} %}{% endblock canonical %}
  9. {% block header_languages %}{% include "/vitrine/articles/components/header_languages.html.twig" with {'article':article} %}{% endblock header_languages %}
  10. {% block footer_languages %}{% include "/vitrine/articles/components/footer_languages.html.twig" with {'article':article} %}{% endblock footer_languages %}
  11. {% block body %}
  12. <section class="pb-90 inner-page-hero blog-page-section">
  13. <div class="container">
  14. <div class="row justify-content-center">
  15. <div class="col-md-8 col-12">
  16. <div class="post-content">
  17. <div class="single-post-title text-center">
  18. <h1 class="s-46 w-700">{{ article.title }}</h1>
  19. <div class="blog-post-meta mt-35">
  20. <ul class="post-meta-list ico-10">
  21. {% if article.author is not null %}
  22. <li><p class="p-md w-500">{{ article.author }} &nbsp;</p></li>
  23. {% else %}
  24. <li><p class="p-md w-500">{{ websitename }} &nbsp;</p></li>
  25. {% endif %}
  26. <li><p class="p-md">&nbsp; &nbsp; {{ "Mis à jour"|translateLocale(arrayTranslate) }} : &nbsp; {{ article.updatedAt|format_date(pattern='dd MMMM yyyy',locale=app.request.locale) }}</p></li>
  27. {% if is_granted("ROLE_SUPER_ADMIN") %}
  28. <li><p class="p-md">&nbsp; &nbsp; <a href="{{ path('backoffice_articles_edit',{'id':article.id}) }}" style="color:red;">Edit</a></p></li>
  29. {% endif %}
  30. </ul>
  31. <div style="margin-top:20px;">
  32. {% if article.category is not null %}
  33. {% if article.category.parent == 0 %}
  34. {% if article.category.category is not null %}
  35. <a class="catparent" href="{% if app.request.locale == "en" %}{{ path('blog_articles_parents',{'slug':article.category.category.slug}) }}{% else %}{{ path('locale_blog_articles_parents',{'_locale':app.request.locale,'slug':article.category.category.slug}) }}{% endif %}">
  36. {% if article.category.category.titleMenu is not empty %}{{ article.category.category.titleMenu }}{% else %}{{ article.category.category.title }}{% endif %}
  37. </a>
  38. <a class="catparent" href="{% if app.request.locale == "en" %}{{ path('blog_articles_parents_category',{'slug':article.category.category.slug,'slug2':article.category.slug}) }}{% else %}{{ path('locale_blog_articles_parents_category',{'_locale':app.request.locale,'slug':article.category.category.slug,'slug2':article.category.slug}) }}{% endif %}">
  39. {% if article.category.titleMenu is not empty %}{{ article.category.titleMenu }}{% else %}{{ article.category.title }}{% endif %}
  40. </a>
  41. {% endif %}
  42. {% else %}
  43. <a class="catparent" href="{% if app.request.locale == "en" %}{{ path('blog_articles_parents',{'slug':article.category.slug}) }}{% else %}{{ path('locale_blog_articles_parents',{'_locale':app.request.locale,'slug':article.category.slug}) }}{% endif %}">
  44. {% if article.category.titleMenu is not empty %}{{ article.category.titleMenu }}{% else %}{{ article.category.title }}{% endif %}
  45. </a>
  46. {% endif %}
  47. {% endif %}
  48. </div>
  49. </div>
  50. </div>
  51. <div class="blog-post-img py-50">
  52. {% if article.image.name is not null %}
  53. <figure class="image">
  54. <picture>
  55. <source srcset="{{ vich_uploader_asset(article, 'imageFile') }}" type="image/webp">
  56. <img class="img-fluid r-16" src="{{ vich_uploader_asset(article, 'imageFile') }}" width="852" height="852" alt="{{ article.imageAlt }}" title="{{ article.imageTitle }}" />
  57. </picture>
  58. </figure>
  59. {% else %}
  60. <figure class="image">
  61. <picture>
  62. <source srcset="/uploads/default_article.webp" type="image/webp">
  63. <img class="img-fluid r-16" src="/uploads/default_article.webp" width="852" height="852" alt="{{ article.imageAlt }}" title="{{ article.imageTitle }}" />
  64. </picture>
  65. </figure>
  66. {% endif %}
  67. </div>
  68. {% if article.descriptionStart is not null %}
  69. <div id="single-post">
  70. {{ autosummaryID(replaceInWebP(replaceLinksRedir(article.descriptionStart)))|raw }}
  71. </div>
  72. {% endif %}
  73. <div class="summary">
  74. <div class="summary__title">{{ "Sommaire"|translateLocale(arrayTranslate) }}</div>
  75. {{ autosummary(replaceInWebP(replaceLinksRedir(article.description)))|raw }}
  76. </div>
  77. {% if article.messageAlert is not empty %}
  78. <div style="background-color: #B4D9F4; padding:20px; border-radius:20px; display: flex; align-items: flex-start; gap: 15px; margin-top:15px; margin-bottom:15px;">
  79. /!\ {{ article.messageAlert|raw }} /!\
  80. </div>
  81. {% endif %}
  82. <div id="single-post">
  83. {{ autosummaryID(replaceInWebP(replaceLinksRedir(article.description)))|raw }}
  84. </div>
  85. {% if article.authorArticle is not null %}
  86. <div style="background-color: #F9F6FF; padding:20px; border-radius:20px; display: flex; align-items: flex-start; gap: 15px;">
  87. <img src="/uploads/authors/{{ article.authorArticle.image.name }}"
  88. alt="{{ article.authorArticle.imageAlt }}"
  89. title="{{ article.authorArticle.imageTitle }}"
  90. style="width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex-shrink: 0;" />
  91. <div style="flex: 1;">
  92. <div style="display: flex; align-items: center; gap: 10px; margin-bottom: 8px;">
  93. <strong>Rédigé par {{ article.authorArticle.author }}</strong>
  94. {% if article.authorArticle.linkedinUrl %}
  95. <a href="{{ article.authorArticle.linkedinUrl }}" target="_blank" style="color: #0077B5; font-size: 18px; text-decoration: none;" title="Profil LinkedIn de {{ article.authorArticle.author }}">
  96. <i class="fab fa-linkedin"></i>
  97. </a>
  98. {% endif %}
  99. </div>
  100. {{ article.authorArticle.description|nl2br|raw }}
  101. </div>
  102. </div>
  103. {% endif %}
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </section>
  109. {% endblock body %}
  110. {% block css %}
  111. <style>
  112. .catparent {
  113. background-color:#E8C9FF;
  114. margin:3px;
  115. padding:6px;
  116. border-radius: 6px;
  117. }
  118. </style>
  119. <style>
  120. .author-card {
  121. background-color: #F9F6FF;
  122. padding: 20px;
  123. border-radius: 20px;
  124. display: flex;
  125. align-items: flex-start;
  126. gap: 15px;
  127. }
  128. .author-image {
  129. width: 60px;
  130. height: 60px;
  131. border-radius: 50%;
  132. object-fit: cover;
  133. flex-shrink: 0;
  134. }
  135. .author-content {
  136. flex: 1;
  137. }
  138. .author-header {
  139. display: flex;
  140. align-items: center;
  141. gap: 10px;
  142. margin-bottom: 8px;
  143. }
  144. .author-name {
  145. font-weight: bold;
  146. margin: 0;
  147. }
  148. .linkedin-icon {
  149. color: #0077B5;
  150. font-size: 18px;
  151. text-decoration: none;
  152. transition: color 0.3s ease;
  153. }
  154. .linkedin-icon:hover {
  155. color: #005885;
  156. }
  157. .author-description {
  158. margin: 0;
  159. line-height: 1.5;
  160. }
  161. /* Version responsive */
  162. @media (max-width: 480px) {
  163. .author-card {
  164. flex-direction: column;
  165. text-align: center;
  166. }
  167. .author-image {
  168. align-self: center;
  169. }
  170. }
  171. </style>
  172. <style>
  173. .summary__title {
  174. font-size:28px !important;
  175. margin-bottom:10px !important;
  176. font-weight: 800 !important;
  177. }
  178. .summary ul, dl, ol {
  179. list-style-type: square;
  180. list-style-position: inside;
  181. padding-top:15px;
  182. padding-bottom:15px;
  183. padding-left: 30px;
  184. padding-right:30px;
  185. background-color: #F9F6FF;
  186. border-radius: 20px;
  187. width: fit-content;
  188. margin-top:10px;
  189. margin-bottom:10px;
  190. }
  191. .summary ul > li {
  192. margin-bottom: 8px;
  193. line-height: 1.4;
  194. }
  195. .summary ul ul {
  196. margin: 0;
  197. padding-top:9px;
  198. padding-bottom:9px;
  199. }
  200. #single-post img {
  201. width: 100% !important;
  202. margin-left:auto;
  203. margin-right:auto;
  204. margin-bottom:20px;
  205. margin-top:20px;
  206. }
  207. #single-post div, p {
  208. font-size:18px !important;
  209. }
  210. #single-post h2 {
  211. font-size:28px !important;
  212. margin-bottom:10px !important;
  213. font-weight: 800 !important;
  214. }
  215. #single-post h3 {
  216. font-size:20px !important;
  217. margin-bottom:10px !important;
  218. font-weight: 800 !important;
  219. }
  220. #single-post h4 {
  221. font-size:18px !important;
  222. margin-bottom:10px !important;
  223. font-weight: 800 !important;
  224. }
  225. #single-post ul, dl, ol {
  226. list-style-type: square; /* puce en carré */
  227. list-style-position: inside; /* la puce est dessinée dans la zone de contenu du <ul> */
  228. padding: 30px; /* haut/bas 12px, gauche/droite 20px → on décale tout vers l’intérieur */
  229. background-color: #F9F6FF;
  230. border-radius: 20px;
  231. width: fit-content;
  232. margin-bottom:20px;
  233. }
  234. #single-post ul > li {
  235. margin-bottom: 8px; /* espace entre chaque ligne pour plus de lisibilité */
  236. line-height: 1.4; /* pour être sûr que la puce ne chevauche pas verticalement */
  237. }
  238. /* 1. Style du conteneur <table> */
  239. #single-post table {
  240. background-color: #F9F6FF; /* même fond que pour les listes */
  241. border-radius: 20px; /* coins arrondis identiques */
  242. width: fit-content; /* largeur qui épousera le contenu */
  243. border-collapse: separate; /* nécessaire pour que les coins arrondis s’appliquent */
  244. border-spacing: 0; /* pas d’espace entre cellules si on veut un tout cohérent */
  245. overflow: hidden; /* clippe tout ce qui dépasse—utile si on ajoute un border-radius */
  246. margin-bottom: 16px; /* espace sous le tableau, à adapter selon besoin */
  247. }
  248. /* 2. Supprimer ou personnaliser les bordures internes */
  249. #single-post table,
  250. #single-post table th,
  251. #single-post table td {
  252. border: none; /* pas de bordure “par défaut” */
  253. }
  254. /* 3. Espacement intérieur au sein des cellules */
  255. #single-post table th,
  256. #single-post table td {
  257. padding: 12px 16px; /* ajustez selon vos goûts : ici 12px en haut/bas, 16px à gauche/droite */
  258. text-align: left; /* on aligne le texte à gauche (peut être modifié) */
  259. line-height: 1.4; /* pour respecter le même “respiration” verticale que vos listes */
  260. }
  261. /* 4. (Optionnel) Si vous voulez ajouter une séparation visuelle entre lignes ou colonnes */
  262. #single-post table tr + tr {
  263. border-top: 1px solid rgba(0,0,0,0.05); /* trait très léger entre chaque ligne */
  264. }
  265. #single-post table th + th,
  266. #single-post table td + td {
  267. border-left: 1px solid rgba(0,0,0,0.05); /* trait vertical entre colonnes */
  268. }
  269. /* 5. (Optionnel) Style des en-têtes (th) */
  270. #single-post table th {
  271. background-color: #EDE8FF; /* un violet encore plus pâle pour distinguer l’en-tête */
  272. font-weight: 600; /* un peu plus gras pour les titres de colonnes */
  273. }
  274. /* 6. (Optionnel) Gestion responsive (pour éviter que le tableau déborde) */
  275. #single-post .table-wrapper {
  276. overflow-x: auto; /* permet le scroll horizontal si le tableau est trop large */
  277. }
  278. </style>
  279. {% endblock css %}