From bf823ef69363738558efae7fc0ce787e52835032 Mon Sep 17 00:00:00 2001 From: Philipp Seibt Date: Fri, 13 Sep 2024 11:20:58 +0200 Subject: [PATCH] Fix news enclosures --- CHANGELOG.md | 4 +++ .../modules/mate/event_mate_full.html5 | 29 +++++++++++++------ .../modules/mate/news_mate_full.html5 | 23 +++++++++++---- src/Module/MateThemeSetup.php | 2 +- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d112dc8..8252a80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Types of changes Security in case of vulnerabilities. ) +## [3.4.2](https://github.com/contao-themes-net/mate-theme-bundle/tree/3.4.2) – 2024-09-13 + +- [Fixed] Fix news enclosures + ## [3.4.1](https://github.com/contao-themes-net/mate-theme-bundle/tree/3.4.1) – 2024-06-17 - [Changed] Update sql files (remove TMG from imprint) diff --git a/contao/templates/modules/mate/event_mate_full.html5 b/contao/templates/modules/mate/event_mate_full.html5 index 39527a3..e1002a1 100644 --- a/contao/templates/modules/mate/event_mate_full.html5 +++ b/contao/templates/modules/mate/event_mate_full.html5 @@ -31,13 +31,15 @@ enclosure): ?> - +
+ +
@@ -46,7 +48,16 @@ $schemaOrg = $this->getSchemaOrgData(); if ($this->hasDetails) { -$schemaOrg['description'] = $this->rawHtmlToPlainText($this->details); + $schemaOrg['description'] = $this->rawHtmlToPlainText($this->details); } -$this->addSchemaOrg($schemaOrg); \ No newline at end of file +$this->addSchemaOrg($schemaOrg); + +if ($this->figure) { + $primaryImage = [ + '@type' => 'WebPage', + 'primaryImageOfPage' => $this->figure->getSchemaOrgData(), + ]; + + $this->addSchemaOrg($primaryImage); +} \ No newline at end of file diff --git a/contao/templates/modules/mate/news_mate_full.html5 b/contao/templates/modules/mate/news_mate_full.html5 index 54c800d..59155dc 100644 --- a/contao/templates/modules/mate/news_mate_full.html5 +++ b/contao/templates/modules/mate/news_mate_full.html5 @@ -17,10 +17,14 @@ enclosure): ?> -
- enclosure as $enclosure): ?> -

()

- +
+
    + enclosure as $enclosure): ?> +
  • + () +
  • + +
@@ -34,4 +38,13 @@ if ($this->hasText) { $schemaOrg['text'] = $this->rawHtmlToPlainText($this->text); } -$this->addSchemaOrg($schemaOrg); \ No newline at end of file +$this->addSchemaOrg($schemaOrg); + +if ($this->figure) { + $primaryImage = [ + '@type' => 'WebPage', + 'primaryImageOfPage' => $this->figure->getSchemaOrgData(), + ]; + + $this->addSchemaOrg($primaryImage); +} \ No newline at end of file diff --git a/src/Module/MateThemeSetup.php b/src/Module/MateThemeSetup.php index 5083f39..c42cce0 100644 --- a/src/Module/MateThemeSetup.php +++ b/src/Module/MateThemeSetup.php @@ -23,7 +23,7 @@ class MateThemeSetup extends BackendModule { - public const VERSION = '3.4.1'; + public const VERSION = '3.4.2'; protected $strTemplate = 'be_mateTheme_setup';