Skip to content

Commit

Permalink
Fix news enclosures
Browse files Browse the repository at this point in the history
  • Loading branch information
seibtph committed Sep 13, 2024
1 parent 9392fe8 commit bf823ef
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
29 changes: 20 additions & 9 deletions contao/templates/modules/mate/event_mate_full.html5
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@
<?php endif; ?>

<?php if ($this->enclosure): ?>
<ul class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<li class="download-element ext-<?= $enclosure['extension'] ?>">
<a href="<?= $enclosure['href'] ?>" title="<?= $enclosure['title'] ?>"><?= $enclosure['link'] ?> <span class="size">(<?= $enclosure['filesize'] ?>)</span></a>
</li>
<?php endforeach; ?>
</ul>
<div class="content-downloads">
<ul class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<li class="download-element ext-<?= $enclosure['extension'] ?>">
<a href="<?= $enclosure['href'] ?>" title="<?= $enclosure['title'] ?>"><?= $enclosure['link'] ?> <span class="size">(<?= $enclosure['filesize'] ?>)</span></a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

</div>
Expand All @@ -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);
$this->addSchemaOrg($schemaOrg);

if ($this->figure) {
$primaryImage = [
'@type' => 'WebPage',
'primaryImageOfPage' => $this->figure->getSchemaOrgData(),
];

$this->addSchemaOrg($primaryImage);
}
23 changes: 18 additions & 5 deletions contao/templates/modules/mate/news_mate_full.html5
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
<?php endif; ?>

<?php if ($this->enclosure): ?>
<div class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<p><?= Image::getHtml($enclosure['icon'], '', 'class="mime_icon"') ?> <a href="<?= $enclosure['href'] ?>" title="<?= $enclosure['title'] ?>"><?= $enclosure['link'] ?> <span class="size">(<?= $enclosure['filesize'] ?>)</span></a></p>
<?php endforeach; ?>
<div class="content-downloads">
<ul class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<li class="download-element ext-<?= $enclosure['extension'] ?>">
<a href="<?= $enclosure['href'] ?>" title="<?= $enclosure['title'] ?>"><?= $enclosure['link'] ?> <span class="size">(<?= $enclosure['filesize'] ?>)</span></a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

Expand All @@ -34,4 +38,13 @@ if ($this->hasText) {
$schemaOrg['text'] = $this->rawHtmlToPlainText($this->text);
}

$this->addSchemaOrg($schemaOrg);
$this->addSchemaOrg($schemaOrg);

if ($this->figure) {
$primaryImage = [
'@type' => 'WebPage',
'primaryImageOfPage' => $this->figure->getSchemaOrgData(),
];

$this->addSchemaOrg($primaryImage);
}
2 changes: 1 addition & 1 deletion src/Module/MateThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit bf823ef

Please sign in to comment.