82 lines
3.4 KiB
PHTML
82 lines
3.4 KiB
PHTML
<?php
|
|
|
|
/**
|
|
* @var \Esun\Homepage\Block\Application $block
|
|
* @var \Magento\Framework\Escaper $escaper
|
|
*/
|
|
|
|
$items = $block->getItems();
|
|
if (!$items) {
|
|
return;
|
|
}
|
|
$exploreAllUrl = $block->getExploreAllUrl();
|
|
?>
|
|
<section class="esun-application" aria-labelledby="esun-application-title">
|
|
<div class="esun-application__heading">
|
|
<h2 class="typo-section-title" id="esun-application-title"><?= $escaper->escapeHtml(__('Application')) ?></h2>
|
|
<div class="esun-application__heading-row">
|
|
<?php if ($block->getSubtitle()): ?>
|
|
<p class="typo-product-title"><?= $escaper->escapeHtml($block->getSubtitle()) ?></p>
|
|
<?php endif; ?>
|
|
<a class="esun-application__explore-all"
|
|
href="<?= $exploreAllUrl ? $escaper->escapeUrl($exploreAllUrl) : '#' ?>"
|
|
<?= $exploreAllUrl ? '' : 'role="link" aria-disabled="true" onclick="return false;"' ?>>
|
|
<?= $escaper->escapeHtml(__('Explore All Use Case')) ?>
|
|
<span aria-hidden="true">></span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="esun-application__items" data-role="esun-application-items">
|
|
<?php foreach ($items as $item): ?>
|
|
<?php
|
|
$thumbnailUrl = (string) ($item['thumbnail_url'] ?: $item['image_url']);
|
|
$hasHoverImage = (string) $item['image_url'] !== '';
|
|
$linkUrl = trim((string) $item['link_url']);
|
|
?>
|
|
<article class="esun-application__item<?= $hasHoverImage ? ' esun-application__item--interactive' : '' ?>"
|
|
<?= $hasHoverImage ? 'tabindex="0"' : '' ?>>
|
|
<?php if ($thumbnailUrl): ?>
|
|
<img class="esun-application__thumbnail"
|
|
src="<?= $escaper->escapeUrl($thumbnailUrl) ?>"
|
|
alt="<?= $escaper->escapeHtmlAttr($item['title']) ?>">
|
|
<?php endif; ?>
|
|
<?php if ($hasHoverImage): ?>
|
|
<img class="esun-application__hover-image"
|
|
src="<?= $escaper->escapeUrl($item['image_url']) ?>"
|
|
alt="">
|
|
<?php endif; ?>
|
|
<span class="esun-application__shade" aria-hidden="true"></span>
|
|
|
|
<div class="esun-application__default-copy">
|
|
<?php if ($item['icon_url']): ?>
|
|
<span class="esun-application__icon">
|
|
<img src="<?= $escaper->escapeUrl($item['icon_url']) ?>" alt="">
|
|
</span>
|
|
<?php endif; ?>
|
|
<h3><?= $escaper->escapeHtml($item['title']) ?></h3>
|
|
</div>
|
|
|
|
<?php if ($hasHoverImage): ?>
|
|
<div class="esun-application__hover-copy">
|
|
<h3><?= $escaper->escapeHtml($item['title']) ?></h3>
|
|
<a class="esun-application__explore"
|
|
href="<?= $linkUrl ? $escaper->escapeUrl($linkUrl) : '#' ?>"
|
|
<?= $linkUrl ? '' : 'aria-disabled="true" onclick="return false;"' ?>>
|
|
<?= $escaper->escapeHtml(__('Explore More')) ?>
|
|
</a>
|
|
</div>
|
|
<?php endif; ?>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<script type="text/x-magento-init">
|
|
{
|
|
"[data-role=esun-application-items]": {
|
|
"Esun_Homepage/js/application": {}
|
|
}
|
|
}
|
|
</script>
|