Need help with theme blocks

Highlighted
Shopify Partner
4 0 0

Greetings,

I was trying to learn Shopify Theme development and I'm stuck in creating blocks for themes. I'm creating a block that will output staff information to one of the pages but I can have the data shown on the page

 

 

<div class="page-width">
{% if section.settings.title != blank %}
<div class="section-header text-center">
  <h2> {{ section.settings.title | escape }} </h2>
</div>

{% endif %}

{% for staff in section.blocks %}
<div>
  <h3> {{ staff.settings.name }} </h3>
  <span> {{ staff.settings.title }} </span>
  <p> {{ staff.settings.bio }} </p>
</div>


{% endfor %}

</div>

{% schema %}

{
 "name":"Team members",
 "class" : "Team-members-section",
 "settings" : [
  {
  "id":"title",
  "type":"text",
  "label":"Section Title",
  "default":"Meet our Team"
    }
  ], 
  "blocks" : [
  {
    "name" : "Team Member",
    "type" : "staff-profile",
    "settings": [
      {
        "id": "staff-name",
        "type": "text",
        "label": "name"
      },
      {
      "id" : "staff-title",
      "type": "text",
      "label" : "title"
      },
      {
      "id" : "staff-bio",
      "type" : "textarea",
      "label" : "bio"
      }   
    ]
    }
  ]
}
{% endschema %}

 

 

Screenshot_8.png

 

Please advise on how I can make this work. Thank you. 

0 Likes
Highlighted
New Member
1 0 1

Hi try this video tutorial, it will help you.

https://www.youtube.com/watch?v=jzhsYMxUp8s&t=572s 

1 Like