Add link to deep article when available

Add conditional logic to display "Les dybdeartikkel" link when redirect
URL is present, otherwise show "Les mer" link
This commit is contained in:
Ruben 2025-10-20 22:17:46 +02:00
parent 22eaf014e1
commit 18782afc7d

View file

@ -28,7 +28,11 @@
<?php if (!empty($item['pdf'])): ?>
<a href="<?= htmlspecialchars($item['pdf']) ?>" class="button" download>Last ned PDF</a>
<?php endif; ?>
<a href="<?= htmlspecialchars($item['url']) ?>" class="button">Les mer</a>
<?php if (!empty($item['redirect'])): ?>
<a href="<?= htmlspecialchars($item['redirect']) ?>" class="button">Les dybdeartikkel</a>
<?php else: ?>
<a href="<?= htmlspecialchars($item['url']) ?>" class="button">Les mer</a>
<?php endif; ?>
</div>
</article>
<?php endforeach; ?>