I have a bit of a problem and i’m not sure how to solve it:
I have a grid-wrapper that contains multiple image-grids from different projects.
The grid shows the image and on hover it shows the name() of the image (in this case the image name is a number, so 1.jpg gets displayed as 1).
<div class="grid-wrapper">
<?php foreach($projects as $project):?>
<div class="image-grid">
<?php foreach($images as $image): ?>
<div class="tile">
<div class="image-grid-number"><?= $image->name()?></div>
<img class="image-grid-img" src="<?= $image->url() ?>" alt="">
</div>
<?php endforeach ?>
</div>
<?php endforeach ?>
</div>
What I want to do is having a input field like this
<input type="text" id="searchInput" placeholder="Search Number">
where the user can type in a number and only sees the image with the corresponding number.
<?php
$projects = page('projects')->children()->listed();
$images = $projects->images();
$filtered = $images->filterBy('name', '*=', '12345');
?>
If I replace $images with $filtered in the foreach-loop it works as intended and shows me only the images with the number 12345 but i would love to have this work with the input field and without the fixed number.
Any help would be greatly appreciated