hi to Processwire LOVELY COMMUNITY!
i have a question about how can i add a class to current viewable image from images field.
my code is like this:
<?php foreach($page->images as $img) { ?>
<div class="item">
<img src="<?php echo $img->url; ?>" />
<div class="container">
<div class="carousel-text">
<h2><?php echo $img->description; ?></h2>
</div><!-- /carousel-text -->
</div><!-- /container -->
</div><!-- /item -->
<?php } ?>
i need to add only for the current image to this div <div class="item"> the class of active, like this <div class="item active">
is there any way to make it happen?
Thank you in advance!