Jurajsimkovic Posted October 26, 2021 Share Posted October 26, 2021 Site URL: https://www.jurajsimkovic.com/projects/slovak-national-theatre Hi, as the title says, I would like to add specific captions to specific images in my gallery and, this is important, I want them to only appear in the lightbox view. I don't want them to appear under the images when viewed casually on the site, without lightbox. Most of them are masonry grid-galleries, one of them is a simple grid-gallery. I have just paid for the personal plan and would like to avoid upgrading and paying for the higher tier business plan. The picture attached to this post should clarify the look of the captions. Thank you in advance. Juraj Link to comment
Beyondspace Posted October 26, 2021 Share Posted October 26, 2021 2 hours ago, Jurajsimkovic said: Site URL: https://www.jurajsimkovic.com/projects/slovak-national-theatre Hi, as the title says, I would like to add specific captions to specific images in my gallery and, this is important, I want them to only appear in the lightbox view. I don't want them to appear under the images when viewed casually on the site, without lightbox. Most of them are masonry grid-galleries, one of them is a simple grid-gallery. I have just paid for the personal plan and would like to avoid upgrading and paying for the higher tier business plan. The picture attached to this post should clarify the look of the captions. Thank you in advance. Juraj You can use the unique id of the image in lightbox to add the caption using css, but it is a painful process and hard to maintain once you got many images on the site BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Jurajsimkovic Posted October 26, 2021 Author Share Posted October 26, 2021 (edited) Could you please elaborate on this process, maybe provide something of a how to guide? I am not proficient with CSS editing - I can't write my own code. I have to note again, I have the personal plan and would like to avoid upgrading to a more expensive one. Edited October 26, 2021 by Jurajsimkovic Link to comment
tuanphan Posted October 29, 2021 Share Posted October 29, 2021 On 10/26/2021 at 9:32 PM, Jurajsimkovic said: Could you please elaborate on this process, maybe provide something of a how to guide? I am not proficient with CSS editing - I can't write my own code. I have to note again, I have the personal plan and would like to avoid upgrading to a more expensive one. Hi. Do you still need help? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
dangarza Posted August 10, 2022 Share Posted August 10, 2022 Hi @tuapan I have the same issue as Jurajsimkovic, I want captions to display on lightbox from my masonry grid which already has your code for hover over captions (thanks!!!) I need the captions to look like the image attached. Any tips? Thanks so much for your help! D Link to comment
tuanphan Posted August 11, 2022 Share Posted August 11, 2022 On 8/10/2022 at 9:08 AM, dangarza said: Hi @tuapan I have the same issue as Jurajsimkovic, I want captions to display on lightbox from my masonry grid which already has your code for hover over captions (thanks!!!) I need the captions to look like the image attached. Any tips? Thanks so much for your help! D What is your site url? We can help easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
dangarza Posted August 16, 2022 Share Posted August 16, 2022 (edited) On 8/11/2022 at 4:18 AM, tuanphan said: What is your site url? We can help easier Thank you! @tuanphanhttps://cobalt-strawberry-9gtg.squarespace.com/config/help Edited August 17, 2022 by dangarza Link to comment
dangarza Posted August 16, 2022 Share Posted August 16, 2022 (edited) @tuanphanAs you can see there´s capttions on hover over in masonry grid, but not when we go to lightbox, that´s what Im missing thanks so much Edited August 17, 2022 by dangarza Link to comment
tuanphan Posted August 18, 2022 Share Posted August 18, 2022 On 8/16/2022 at 10:44 PM, dangarza said: @tuanphanAs you can see there´s capttions on hover over in masonry grid, but not when we go to lightbox, that´s what Im missing thanks so much Your site is private. Can you setup an access password & share url again? https://cobalt-strawberry-9gtg.squarespace.com/?noredirect Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
dangarza Posted August 18, 2022 Share Posted August 18, 2022 Hi @tuanphan I made it public 🙂 here's the link https://cobalt-strawberry-9gtg.squarespace.com galleries in exhibitions have the style I talked about, hope this guves you a better idea thanks! Link to comment
tuanphan Posted August 21, 2022 Share Posted August 21, 2022 On 8/18/2022 at 11:39 PM, dangarza said: Hi @tuanphan I made it public 🙂 here's the link https://cobalt-strawberry-9gtg.squarespace.com galleries in exhibitions have the style I talked about, hope this guves you a better idea thanks! Can you enable Gallery Section Caption & add some demo text? We will test some code to achieve this https://cobalt-strawberry-9gtg.squarespace.com/exhibitions-1/nf Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
dangarza Posted August 22, 2022 Share Posted August 22, 2022 On 8/20/2022 at 9:26 PM, tuanphan said: Can you enable Gallery Section Caption & add some demo text? We will test some code to achieve this https://cobalt-strawberry-9gtg.squarespace.com/exhibitions-1/nf @tuanphan done! thanks so much! Link to comment
tuanphan Posted August 24, 2022 Share Posted August 24, 2022 On 8/22/2022 at 11:50 PM, dangarza said: @tuanphan done! thanks so much! Try adding this to Code Injection > Footer <script> document.addEventListener("DOMContentLoaded", function() { function render(checked, index) { (function(p, show) { var map; var values; var messageValue; var messages; var name; var type; var k; map = document.querySelectorAll(p ? p : 'section.gallery-section,\x20.gallery-lightbox'); name = map.length; for (; name--;) { values = map[name].querySelectorAll(show ? show : '[class*=\x27-item\x27]:not([class*=\x27item-\x27])'); type = values.length; for (; type--;) { messageValue = values[type].getElementsByTagName('img')[0]['alt']['trim'](); if (messageValue && messageValue.includes("png") == false && messageValue.includes("jpg") == false) { messages = document.createElement('div'); messages.className = 'gallery-item-description'; messages.textContent = messageValue; values[type].appendChild(messages); } } } })(checked, index); } render(); }); </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
acheam Posted July 10 Share Posted July 10 (edited) On 8/24/2022 at 10:59 AM, tuanphan said: Try adding this to Code Injection > Footer <script> document.addEventListener("DOMContentLoaded", function() { function render(checked, index) { (function(p, show) { var map; var values; var messageValue; var messages; var name; var type; var k; map = document.querySelectorAll(p ? p : 'section.gallery-section,\x20.gallery-lightbox'); name = map.length; for (; name--;) { values = map[name].querySelectorAll(show ? show : '[class*=\x27-item\x27]:not([class*=\x27item-\x27])'); type = values.length; for (; type--;) { messageValue = values[type].getElementsByTagName('img')[0]['alt']['trim'](); if (messageValue && messageValue.includes("png") == false && messageValue.includes("jpg") == false) { messages = document.createElement('div'); messages.className = 'gallery-item-description'; messages.textContent = messageValue; values[type].appendChild(messages); } } } })(checked, index); } render(); }); </script> This code seems to almost work. Just now I have caption twice in the lightbox and in the gallery view. Any idea what causes duplication of the caption text? It adds .gallery-item-description but it does not hide the out-of-the-box .gallery-caption so the text is shown twice. How to fix it and only show text once? Edited July 10 by acheam Link to comment
tuanphan Posted July 14 Share Posted July 14 On 7/11/2023 at 2:20 AM, acheam said: This code seems to almost work. Just now I have caption twice in the lightbox and in the gallery view. Any idea what causes duplication of the caption text? It adds .gallery-item-description but it does not hide the out-of-the-box .gallery-caption so the text is shown twice. How to fix it and only show text once? Can you share link to page where you use masonry? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care 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