Hello, hope you’re all good.
I have two small questions, I try to have a link with read more text. To get there I’m using a simple css exemple I found online.
- is it a good practice? what would be best?
- with a simple text field the hide/show it is working, even with <?= $item->text()?>, but if I ask for ->markdown() or ->kt() then it show the text but the read more is not working anymore
Can you help me? Thank you
<?php
$items = false;
if($root = $pages->findOpen()) {
$items = $root->children()->listed();
}
if($items and $items->isNotEmpty()):
?>
<?php foreach($items as $item): ?>
<li class="separateur">
<?php e($item->isOpen(), 'class="active"') ?>
<h1><?= $item->title()->kt() ?></h1>
<?= h($item->subtitle()->markdown(), true) ?>
<input class="read-more-state" id="read-more-controller" type="checkbox">
<div class="read-more-wrap">
<p class="read-more-target"><?= $item->text()->markdown() ?></p>
</div>
<label class="read-more-trigger" for="read-more-controller"></label>
</li>
<?php endforeach ?>
<?php endif ?>