Sherkin Posted October 21, 2022 Share Posted October 21, 2022 I am trying to get a gallery block in 7.1 to display the file name as the Title. I have "show title" ticked in Design panel. I have tried some scripts from the forum, but they dont seem to work with 7.1 As I have hundreds of images to upload, i dont want to manually type the "Titles" in when the title is correct is the file name I upload. Any help, most appreciated. With thanks Adrian Link to comment
tuanphan Posted October 23, 2022 Share Posted October 23, 2022 You can try this code, if you haven't entered caption, the code will get file name as caption Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Ian_A Posted November 20, 2023 Share Posted November 20, 2023 Old topic, but incase anyone is still in need of a solution, here is how I do it with jQuery. I apply the code per page as I only use it on specific gallery pages made for client previews. <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> <script> // Function to replace image-slide-title content with alt tag for images within sqs-gallery-container using jQuery $(document).ready(function() { $('.sqs-gallery-container img').each(function(index) { $('.image-slide-title').eq(index).html($(this).attr('alt').replace('.jpg', '')); }); }); </script> tuanphan 1 Link to comment
SST Posted December 14, 2023 Share Posted December 14, 2023 Hi Ian, do you have by any chance a code for some know metadata issues of Squarespace?! Gallery Blocks are supposed to import TITLE and DESCRIPTION. BUT they import FILENAME and DESCRIPTION which is a mess. I d be happy if you can help with that issue?! Squarespace wasn t able to fix this in over a year. 🙂 All the best and thanks a lot. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment