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 %}
Please advise on how I can make this work. Thank you.
Hi try this video tutorial, it will help you.
User | Count |
---|---|
688 | |
138 | |
104 | |
63 | |
36 |