Jump to content

Brine Gallery Caption Customization

Recommended Posts

1 hour ago, dmricciardi99 said:

Site URL: https://www.smorgasburg.com/

Hi, 

 

Im currently using Brine 7.0 and Im trying to edit the vendor page on my site.  The gallery captions are not working with the CSS customization codes I have found.  I am trying to have the vendor name in bold and the location underneath on a separate line.  Is that possible?

 

 

Do you mean making the first part (before the first dot) of image title bold and breaking the second part into a new line under the first part?

image.png.cb46b6d01600ef200795fc9436106a11.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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
3 hours ago, dmricciardi99 said:

Yes.  Something like this. 

2 Belize Girls

PP

 

Like that.  Thank you!

 

 

Try the following steps:

1. Add in Home > Settings > Advance > Code Injection > Footer

const imgTitles = $$('#block-yui_3_17_2_1_1631287893420_11976 .image-slide-title')
imgTitles.forEach(title => {
    const i = title.innerHTML.search('•');
    const first = title.innerHTML.slice(0, i - 1);
    const second = title.innerHTML.slice(i + 1);
    const html = `<h4>${first}</h4><p>${second}</p>`;
    title.innerHTML = html;
})

2. Add in Home > Design > Custom Css to remove some margin for a better look

#block-yui_3_17_2_1_1631287893420_11976 .image-slide-title h4 {
  margin-top:0;
  margin-bottom:0;
}

#block-yui_3_17_2_1_1631287893420_11976 .image-slide-title p {
  margin-top:0;
  margin-bottom:0;
}

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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

Here is the result after configuration

image.thumb.png.f65e53aab645b61206deaee4ab6ff103.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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
On 10/6/2021 at 1:20 AM, dmricciardi99 said:

Also, that footer code was visible on the bottom of the site...

 

#1 code is missing script tag, use this new code for #1

<script>
  const imgTitles = $$('#block-yui_3_17_2_1_1631287893420_11976 .image-slide-title')
imgTitles.forEach(title => {
    const i = title.innerHTML.search('•');
    const first = title.innerHTML.slice(0, i - 1);
    const second = title.innerHTML.slice(i + 1);
    const html = `<h4>${first}</h4><p>${second}</p>`;
    title.innerHTML = html;
})
</script>

 

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
1 hour ago, tuanphan said:

#1 code is missing script tag, use this new code for #1

<script>
  const imgTitles = $$('#block-yui_3_17_2_1_1631287893420_11976 .image-slide-title')
imgTitles.forEach(title => {
    const i = title.innerHTML.search('•');
    const first = title.innerHTML.slice(0, i - 1);
    const second = title.innerHTML.slice(i + 1);
    const html = `<h4>${first}</h4><p>${second}</p>`;
    title.innerHTML = html;
})
</script>

 

Is there a typo where you put double $ sign

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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
On 10/7/2021 at 9:35 PM, dmricciardi99 said:

i keep getting an syntax error message with this code.  { this is missing opening as well.

Replace the old scripts with the following one:

const imgTitles = document.querySelectorAll('#block-yui_3_17_2_1_1631287893420_11976 .image-slide-title');
imgTitles.forEach(title => {
    const i = title.innerHTML.search('•');
    const first = title.innerHTML.slice(0, i - 1);
    const second = title.innerHTML.slice(i + 1);
    const html = `<h4>${first}</h4><p>${second}</p>`;
    title.innerHTML = html;
})

This answer is confirmed working

Edited by bangank36

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 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

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.