init
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @var \Esun\Homepage\Block\ResourcesDownloads $block
|
||||
* @var \Magento\Framework\Escaper $escaper
|
||||
*/
|
||||
|
||||
$items = $block->getItems();
|
||||
if (!$items) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<section class="esun-resources-downloads" aria-labelledby="esun-resources-downloads-title">
|
||||
<h2 class="typo-section-title" id="esun-resources-downloads-title">
|
||||
<?= $escaper->escapeHtml(__('Resources & Downloads')) ?>
|
||||
</h2>
|
||||
|
||||
<div class="esun-resources-downloads__items">
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?php $linkUrl = trim((string) $item['link_url']); ?>
|
||||
<article class="esun-resources-downloads__item">
|
||||
<?php if ($linkUrl): ?>
|
||||
<a class="esun-resources-downloads__link"
|
||||
href="<?= $escaper->escapeUrl($linkUrl) ?>"
|
||||
aria-label="<?= $escaper->escapeHtmlAttr(__('Open %1', $item['title'])) ?>">
|
||||
<span aria-hidden="true">↗</span>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<span class="esun-resources-downloads__link esun-resources-downloads__link--disabled"
|
||||
aria-hidden="true">↗</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<img class="esun-resources-downloads__image"
|
||||
src="<?= $escaper->escapeUrl($item['thumbnail_url']) ?>"
|
||||
alt="<?= $escaper->escapeHtmlAttr($item['title']) ?>">
|
||||
|
||||
<?php if ($item['title']): ?>
|
||||
<h3><?= $escaper->escapeHtml($item['title']) ?></h3>
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user