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
  • Replies 2
  • Views 894
  • Created
  • Last Reply
5 minutes ago, tuanphan said:

Summary Block use different class name. Can you share link to page where you use grid summary?

Here it is, it's currently just a test page right now and got a plugin called 'Universal Filter' injected.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.