We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Dawn theme: How to add text overlays to product images on collection pages?

Solved

Dawn theme: How to add text overlays to product images on collection pages?

ColossalBird
Tourist
4 0 3

Hi everyone, 

 

I'm pretty new to Shopify and currently using the Dawn theme.
I'd like to add text overlays to my product images on collection pages—something simple like showing one or two metafields (e.g. country of origin) on the bottom-left corner of each image like here:

ColossalBird_0-1749989186444.png

 

I don’t need to display the product title, just the custom text from those metafields.

Any help would be greatly appreciated. 

 

 

Thanks in advance!

Accepted Solution (1)

TheUntechnickle
Shopify Partner
555 66 163

This is an accepted solution.

Hey @ColossalBird,

 

I can definitely help you with this! Adding text overlays to your product images in Dawn is totally doable and will look great on your collection pages.

 

Here's what you'll need to do:

 

First, find your product card file - it's usually in snippets/product-card.liquid or sometimes in the collection template. Look for where the product images are being displayed.

 

Then add your overlay code right after the image container:

 

<div class="product-overlay">
  {% if product.metafields.custom.country_of_origin %}
    <span class="overlay-text">{{ product.metafields.custom.country_of_origin }}</span>
  {% endif %}
  {% if product.metafields.custom.another_field %}
    <span class="overlay-text">{{ product.metafields.custom.another_field }}</span>
  {% endif %}
</div>

 

And add this CSS to make it look nice (probably in your base.css file):

 

.card__media {
  position: relative;
}

.product-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
}

.overlay-text {
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 3px;
  display: block;
  margin-bottom: 4px;
}

 

Don't forget to set up your metafields! Go to Settings > Metafields > Products and create the custom fields you want to display. The namespace should be "custom" and the key would be something like "country_of_origin".

 

This should give you exactly what you're looking for - those nice little text overlays in the bottom corner just like in your example images!

 

Let me know if you run into any issues or need help tweaking the styling. Happy to help troubleshoot!

 

Cheers!

Shubham | Untechnickle

Helping for free: hello@untechnickle.com


Don't forget to say thanks, it'll make my day - just send me an email! 


Get Revize for Free | Let your shoppers edit orders post-purchase | Get Zero Support Tickets | #1 Order Editing + Upsell App

View solution in original post

Replies 4 (4)

devcoders
Shopify Partner
1654 190 545

Hello @ColossalBird 
Welcome to the Shopify Community! Please share your store URL and password (if it’s password-protected), so I can check and provide you with the exact solution.

Shopify Developer: Helping eCommerce Stores
If you need assistance with your store, feel free to contact us at devcodersp@gmail.com
WhatsApp No: +91 8516919310 If my assistance was helpful, please consider liking and accepting the solution. Thank you!
ColossalBird
Tourist
4 0 3

Hi @devcoders 

Thanks for your quick response, here is my store URL.
Here is my store, you can access it without password.

 

TheUntechnickle
Shopify Partner
555 66 163

This is an accepted solution.

Hey @ColossalBird,

 

I can definitely help you with this! Adding text overlays to your product images in Dawn is totally doable and will look great on your collection pages.

 

Here's what you'll need to do:

 

First, find your product card file - it's usually in snippets/product-card.liquid or sometimes in the collection template. Look for where the product images are being displayed.

 

Then add your overlay code right after the image container:

 

<div class="product-overlay">
  {% if product.metafields.custom.country_of_origin %}
    <span class="overlay-text">{{ product.metafields.custom.country_of_origin }}</span>
  {% endif %}
  {% if product.metafields.custom.another_field %}
    <span class="overlay-text">{{ product.metafields.custom.another_field }}</span>
  {% endif %}
</div>

 

And add this CSS to make it look nice (probably in your base.css file):

 

.card__media {
  position: relative;
}

.product-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
}

.overlay-text {
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 3px;
  display: block;
  margin-bottom: 4px;
}

 

Don't forget to set up your metafields! Go to Settings > Metafields > Products and create the custom fields you want to display. The namespace should be "custom" and the key would be something like "country_of_origin".

 

This should give you exactly what you're looking for - those nice little text overlays in the bottom corner just like in your example images!

 

Let me know if you run into any issues or need help tweaking the styling. Happy to help troubleshoot!

 

Cheers!

Shubham | Untechnickle

Helping for free: hello@untechnickle.com


Don't forget to say thanks, it'll make my day - just send me an email! 


Get Revize for Free | Let your shoppers edit orders post-purchase | Get Zero Support Tickets | #1 Order Editing + Upsell App

ColossalBird
Tourist
4 0 3

It works great, many thanks!!