Anyone know of a way to create multiple categories within a FAQ section?
This is what I currently have but it “skips” a section.
{% schema %}
{
“name”: “FAQ SECTION”,
“settings”: ,
“blocks”: [
{
“type”:“text”,
“name”:“QA One”,
“settings”:[
{
“id”:“question”,
“type”:“text”,
“label”:“the question”
},
{
“id”:“answer”,
“type”:“richtext”,
“label”:“the answer”
}
]
},
{
“type”:“text”,
“name”:“QA Two”,
“settings”:[
{
“id”:“question_two”,
“type”:“text”,
“label”:“the question”
},
{
“id”:“answer_two”,
“type”:“richtext”,
“label”:“the answer”
}
]
}
]
}
{% endschema %}
{% javascript %}
var acc = document.getElementsByClassName(“accordion-faq”);
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener(“click”, function() {
this.classList.toggle(“active”);
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + “px”;
}
});
}
{% endjavascript %}
