I am making a portfolio site with kirby cms. my site is a single page website. I want to add an incrementing number after id by using foreach in the part shown in the code below..! Is there easy way to do..? regards,
<?php foreach ($pages->listed() as $p): ?>
<div class="slideshow">
<div class="slideshow-box">
<div class="slideshow-holder">
<?php foreach ($p->images() as $workimage): ?>
<div class="slide">
<?= $workimage ?><br><br>
</div>
<?php endforeach ?>
</div>
<div class="tooltip">
<p id="myText<here>"><?= $p->worktitle() ?></p>
</div>
<div class="toolbox" id="myDIV<here>">
<?= $p->description() ?>
</div>
</div>
<div class="actions">
<span>1/3</span>
</div>
<a href="#" class="prev">←</a>
<a href="#" class="next">→</a>
</div>
<?php endforeach ?>
<script>
var button<here> = document.getElementById('myText<here>');
var div<here> = document.getElementById('myDIV<here>');
div<here>.style.display = 'none';
button<here>.onclick = function () {
if (div<here>.style.display !== 'none') {
div<here>.style.display = 'none';
} else {
div<here>.style.display = 'block';
}
};
</script>