add a title inside the featured collection

add a title inside the featured collection

orhl1234
Shopify Partner
110 0 6

I'm trying to add a title inside the featured collection.

in the index.JSOn file, I added the bold code.

    "16e24524-2040-41a4-b5ca-3a425d62879b": {
      "type": "featured-collections",
      "blocks": {
        "8e756427-f886-410c-b65a-f8a1f0767ff1": {
          "type": "collection-slide",
          "settings": {
            "color_scheme_text": "text-colors-inverse",
            "collection": "matching-sets-bikini-kimono",
            "image": "shopify:\/\/shop_images\/DSF3064_24.jpg",
            "title": "MATCHING SETS: BIKINI & KIMONO",
            "subheading": "testing"          }

in the card collection, I add the new bold code:

 

    <div class="card-collection__content">
      <h3 class="card-collection__title">
        {{- title -}}
      </h3><!-- /.card-collection__title -->
      <h3>{{- block.settings.subheading -}}</h3>      <span class="link card-collection__link">
        {{- 'featured-collections.card.link' | t -}}
      </span>
    </div>

How can I make it work? 
thanks in advance!

https://lbst27pm68ni1o72-52839809193.shopifypreview.com

 

orhl1234_0-1724232772868.png

 

Replies 4 (4)

saim007
Shopify Partner
602 74 102

@orhl1234 Your index.json code is missing JSON closure, here is the corrected code 

 

{
  "16e24524-2040-41a4-b5ca-3a425d62879b": {
    "type": "featured-collections",
    "blocks": {
      "8e756427-f886-410c-b65a-f8a1f0767ff1": {
        "type": "collection-slide",
        "settings": {
          "color_scheme_text": "text-colors-inverse",
          "collection": "matching-sets-bikini-kimono",
          "image": "shopify://shop_images/DSF3064_24.jpg",
          "title": "MATCHING SETS: BIKINI & KIMONO",
          "subheading": "testing"
        }
      }
    }
  }
}
Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
orhl1234
Shopify Partner
110 0 6

hi there!
here is the full code and it's ending.

it does have a closure, doesn't it?

orhl1234_1-1724237363220.png

 

saim007
Shopify Partner
602 74 102

@orhl1234 Replace your code 

 

Current Code - 

<h3>{{- block.settings.subheading -}}</h3>

 

Replace with this - 

{% for block in section.blocks %}
      <h3>{{- block.settings.subheading -}}</h3>
{% endfor %}

make sure you write the code in the featured-collections.liquid file.

 

Please let me know!

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
orhl1234
Shopify Partner
110 0 6

It's still not working sadly.

But I put it in the card-product as I found the code of the exciting title, so I just added your code below it.

orhl1234_0-1724252687222.png