From 844f3036751a2a9d44092d1a4c990516badc4dd6 Mon Sep 17 00:00:00 2001 From: Marko Cupic Date: Tue, 12 Dec 2023 21:58:59 +0100 Subject: [PATCH] Use the article tag to mark an album item --- .../templates/_new/component/_album.html.twig | 26 +++++++++---------- .../component/_album_detail_view.html.twig | 6 ++--- .../AbstractGalleryCreatorController.php | 1 + 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/contao/templates/_new/component/_album.html.twig b/contao/templates/_new/component/_album.html.twig index 7049c75..f051cd1 100644 --- a/contao/templates/_new/component/_album.html.twig +++ b/contao/templates/_new/component/_album.html.twig @@ -13,16 +13,16 @@ %} {% endif %} - + {% block album_figure %} - {% if album_href_attributes|default %} + {% if album_href_attributes|default %} - {% endif %} + {% endif %} {% if album.figure.build|default %}{% with {figure: album.figure.build} %}{{ block('figure_component') }}{% endwith %}{% endif %} - {% if album_href_attributes|default %} + {% if album_href_attributes|default %} - {% endif %} + {% endif %} {% endblock %} @@ -39,46 +39,46 @@ {% endblock %} {% block album_date %} - {{ album.date|date('Y-m-d') }}

+ {% endblock %} {% if album.location|default %} {% block album_location %} - {{ 'GALLERY_CREATOR.location'|trans }}: {{ album.location }}

+ {{ 'GALLERY_CREATOR.location'|trans }}: {{ album.location }} {% endblock %} {% endif %} {% if album.photographer|default %} {% block album_photographer %} - {{ 'GALLERY_CREATOR.photographerName'|trans }}: {{ album.photographer }}

+ {{ 'GALLERY_CREATOR.photographerName'|trans }}: {{ album.photographer }} {% endblock %} {% endif %} {% if album.teaser|default %} {% block album_teaser %} - {{ album.teaser|raw|nl2br }}

+ {{ album.teaser|raw|nl2br }} {% endblock %} {% endif %} {% if album.pictureCount|default(0) %} {% block album_picture_count %} - {{ album.pictureCount }} {{ 'GALLERY_CREATOR.pictures'|trans }}

+ {{ album.pictureCount }} {{ 'GALLERY_CREATOR.pictures'|trans }} {% endblock %} {% endif %} {% if album.visitors|default(0) %} {% block album_visitors %} - {{ album.visitors }} {{ 'GALLERY_CREATOR.visitors'|trans }}

+ {{ album.visitors }} {{ 'GALLERY_CREATOR.visitors'|trans }} {% endblock %} {% endif %} {% if album.hasChildAlbums|default %} {% block album_child_album_count %} - {{ album.childAlbumCount }} {{ 'GALLERY_CREATOR.childAlbums'|trans }}

+ {{ album.childAlbumCount }} {{ 'GALLERY_CREATOR.childAlbums'|trans }} {% endblock %} {% endif %} - + {% endblock %} diff --git a/contao/templates/_new/component/_album_detail_view.html.twig b/contao/templates/_new/component/_album_detail_view.html.twig index 82a6d1e..29cfd58 100644 --- a/contao/templates/_new/component/_album_detail_view.html.twig +++ b/contao/templates/_new/component/_album_detail_view.html.twig @@ -5,7 +5,7 @@ {% block album_detail_view %} {% set album_detail_view_attributes = attrs(album_detail_view_attributes|default).addClass('gc-album-detail-view').set('data-album-level', level) %} - + {% block album_detail_article_pre %} @@ -33,7 +33,7 @@ {% block album_detail_date %} {% if album.dateFormatted|default %} - {{ album.dateFormatted }} + {{ album.dateFormatted }} {% endif %} {% endblock %} @@ -76,7 +76,7 @@ {% endif %} {% endblock %} - + {% block album_detail_script %} {# Add your javascript here. #} diff --git a/src/Controller/ContentElement/AbstractGalleryCreatorController.php b/src/Controller/ContentElement/AbstractGalleryCreatorController.php index dd58be3..8bbb328 100644 --- a/src/Controller/ContentElement/AbstractGalleryCreatorController.php +++ b/src/Controller/ContentElement/AbstractGalleryCreatorController.php @@ -164,6 +164,7 @@ public function getAlbumData(GalleryCreatorAlbumsModel $album, ContentModel $con $arrAlbum['caption'] = $strCaption; $arrAlbum['markdownCaption'] = $strMarkdown ?: false; $arrAlbum['dateFormatted'] = Date::parse(Config::get('dateFormat'), $album->date); + $arrAlbum['datimFormatted'] = Date::parse(Config::get('datimFormat'), $album->date); $arrAlbum['meta'] = new Metadata($arrMeta); $arrAlbum['href'] = $href; $arrAlbum['pictureCount'] = $pictureCount;