Jump to content

Use filename as a title for images in a Grid-Summary Block?

Recommended Posts

As the title asks, I'm trying to avoid having to manually input the name of hundreds of images on my site.
I have used this code in the past and it works just fine with Gallery Blocks:
 
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh" crossorigin="anonymous"></script>
<script> window.Squarespace.onInitialize(Y, function(){
$('.slide img').each(function(i) {
$('.image-slide-title').eq(i).html('' + $(this).attr('alt').replace('.jpg', '') + '');
});
});
</script>
 
Any other suggestions would also be massively appreciated!
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.