Dawn Online Store 2.0 block not showing on home page

Widegrid
Shopify Partner
4 0 5

I have created a custom section in the Online Store 2.0, Dawn theme version 8.0.0 and I am trying to get the block to show on the home page, after selecting the image and adding the url. But for some reason it is not showing. Please can some help be provided. Thank you.

 

Section:

<div>
  <h2>{{ section.settings.title | escape }}</h2>

  {% for block in section.blocks %}
    {% case block.type %}

      {% when 'trustBadgesImage' %}
      {% if section.blocks.size > 0 %}
        <ul>
          {% for block in section.blocks %}
            <li class="trust-badge-section" {{ block.shopify_attributes }}>
              {% if block.settings.trustBadgeslink != blank %}
                <a href="{{ block.settings.trustBadgeslink }}">
                {% endif %}
                {% if block.settings.trustBadgesImage != blank %}
                  {{ block.settings.trustBadgesImage | img_url: '150x150', scale: 2 | img_tag: block.settings.trustBadgesImage.alt, 'trust-badge__image' }}
                {% else %}
                  {{ 'logo' | placeholder_svg_tag: 'placeholder-svg' }}
                {% endif %}
                {% if block.settings.trustBadgeslink != blank %}
                </a>
              {% endif %}
            </li>
          {% endfor %}
        </ul>
      {% endif %}

    {% endcase %}
  {% endfor %}
</div>

{% schema %}
  {
    "name": "Trust Badge",
    "tag": "section",
    "class": "trust-badges",
    "max_blocks": 8,
    "settings": [
      {
        "type": "text",
        "id": "trustBadgesTitle",
        "label": "Heading"
      }, {
        "type": "select",
        "id": "trustBadgeslogo_width",
        "label": "Logo width",
        "default": "150px",
        "options": [
          {
            "label": "Extra Small",
            "value": "100px"
          },
          {
            "label": "Small",
            "value": "125px"
          },
          {
            "label": "Medium",
            "value": "150px"
          },
          {
            "label": "Large",
            "value": "175px"
          }, {
            "label": "Extra Large",
            "value": "200px"
          }
        ]
      }
    ],
    "blocks": [
      {
        "name": "Trust Badge Image",
        "type": "trustBadges",
        "settings": [
          {
            "type": "image_picker",
            "id": "trustBadgesImage",
            "label": "Image"
          }, {
            "type": "url",
            "id": "trustBadgeslink",
            "label": "Link",
            "info": "Optional"
          }
        ]
      }
    ]
  }
{% endschema %}

index.json:

"trust-badges": {
      "type": "trust-badges",
      "settings": {
        "trustBadgesTitle": "Trust Badge Heading"
        },
        "blocks":{
        "trustBadges": {
          "type": "trustBadges",
          "settings": {
          } 
        }
      },
      "block_order": [
        "trustBadgesTitle",
        "trustBadges"
      ]
    }
},
  "order": [
    "image_banner",
    "trust-badges",
    "rich_text",
    "featured_collection",
    "collage",
    "video",
    "multicolumn"
  ]



Replies 3 (3)

KetanKumar
Shopify Partner
37094 3645 12054

@Widegrid 

oh sorry for that issue but you have missing main part 

Presets are default configurations of sections and are added within a section's {% schema %} tags. In our simple example, the presets could look like:

"presets": [
{
"name": "Trust Badge",
"category": "Custom"
}
]

more clear this Shopify First section 

How to Create Your First Shopify Theme Section

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Widegrid
Shopify Partner
4 0 5

I have added the presets into the schema, but the block is still not showing.

Widegrid
Shopify Partner
4 0 5

@KetanKumar I have added the presets into the schema, but the block is still not showing.