Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
Our FAQ page has an accordion style layout, but doesn't seem to allow hyperlinks in the text. Unfortunately I'm unable to contact the person who designed our theme, so I'm hoping to find a workaround.
Is there a way to edit this in the theme to allow hyperlinked text?
Thank you in advance.
Solved! Go to the solution
This is an accepted solution.
Sorry try this one.
<div class="content-indent {{ section.settings.top-offeset}}">
{% if section.settings.section_cov %}<div class="section-cover" style="background-color:{{section.settings.sec_bg_clr}};">{% endif%}
<div class="{% unless section.settings.section_width %}page-width default-page{% else %} fullwidth-{{section.id}}{% endunless %}" style="margin-top: -6rem;">
{%- if section.settings.title != blank or section.settings.subtitle != blank -%}
<div class="sec-ttl {{ settings.title_align}} wow fadeIn">
<h3 class="h3">{{ section.settings.title }}</h3>
{%- if section.settings.subtitle != blank -%}<span>{{section.settings.subtitle}}</span>{%- endif -%}
</div>
{% endif %}
<div id="faq" class="{% if section.settings.enable_acc %}accor{% else %}no-accor{% endif %}{% if section.settings.enable_narrow %} narrow m_auto{% endif %}">
{% for block in section.blocks limit: section.blocks.size%}
{% if block.type == 'faqsection' %}
{% if block.settings.sectiontitle != blank %}
<h3>{{block.settings.sectiontitle}}</h3>
{% endif %}
{% endif %}
{% if block.type == 'faqs' %}
<div class="faq-body">
<h4 class="p_ttl {{section.settings.acc_style}} m0">{{ block.settings.question}} </h4>
<div id="{{ block.id }}" class="p_con">
{{ block.settings.answer}}
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% if section.settings.section_cov %}</div> {% endif %}
</div>
<style>
.p_ttl{ color:{{section.settings.questions}}; border-bottom:1px solid {{section.settings.borders}}; }
.p_con{color:{{section.settings.answers}};}
.p_ttl:before {color:{{section.settings.icons}}; }
.fullwidth-{{section.id}} { padding-left:{{ section.settings.pad-mbl}}px; padding-right:{{ section.settings.pad-mbl}}px; }
@media only screen and (min-width: 768px){
.fullwidth-{{section.id}} { padding-left:{{ section.settings.pad-desk}}px; padding-right:{{ section.settings.pad-desk}}px; }
}
</style>
{% schema %}
{
"name": "FAQ",
"settings": [
{
"type": "textarea",
"id": "title",
"label": "Heading",
"default": "Heading",
"info":"Use <strong>text here</strong> to make headings bold"
},
{
"type": "textarea",
"id": "subtitle",
"label": "Sub Heading",
"default": "Describe your products, collection, content etc..."
},
{
"type": "paragraph",
"content":"Section==="
},
{
"type": "select",
"id": "top-offeset",
"label": "Top OffSet",
"default": "default",
"options": [
{
"value": "default",
"label": "Default"
},
{
"value": "small",
"label": "Small"
},
{
"value": "none",
"label": "None"
}
]
},
{
"type":"checkbox",
"id":"section_width",
"label":"Fullwidth?",
"default": false
},
{
"type": "paragraph",
"content": "Left/Right Padding for Fullwidth ==="
},
{
"type": "range",
"id": "pad-desk",
"label": "Desktop",
"default": 55,
"min": 0,
"max": 100,
"step": 1
},
{
"type": "range",
"id": "pad-mbl",
"label": "Mobile",
"default": 15,
"min": 0,
"max": 15,
"step": 1
},
{
"type": "checkbox",
"id": "section_cov",
"label": "Add Background?",
"default": false
},
{
"type": "color",
"id": "sec_bg_clr",
"label": "Background",
"default":"#fafafa",
"info":"select light color"
},
{
"type": "checkbox",
"id": "enable_acc",
"label": "Enable Accordion?",
"default": false
},
{
"type": "select",
"id": "acc_style",
"label": "Accordion icons",
"default": "icons_1",
"options": [
{
"value": "icons_1",
"label": "Plus/Minus"
},
{
"value": "icons_2",
"label": "Up/Down Arrows"
}
]
},
{
"type": "checkbox",
"id": "enable_narrow",
"label": "Narrow width?",
"default": false
},
{
"type": "color",
"id": "sec-title-bg",
"label": "Section Title Background",
"default": "#333"
},
{
"type": "color",
"id": "sec-title",
"label": "Section Title",
"default": "#eee"
},
{
"type": "color",
"id": "questions",
"label": "Questions",
"default": "#444"
},
{
"type": "color",
"id": "answers",
"label": "Answers",
"default": "#444"
},
{
"type": "color",
"id": "icons",
"label": "Icons",
"default": "#333"
},
{
"type": "color",
"id": "borders",
"label": "Borders",
"default": "#eee"
}
],
"blocks":[
{
"type": "faqsection",
"name": "Section Title",
"settings": [
{
"type": "text",
"id": "sectiontitle",
"label": "Section Title"
}
]
},
{
"type":"faqs",
"name":"FAQs",
"settings":[
{
"type":"text",
"id":"question",
"label":"Question",
"default":"Is Optimal compatible with Shopify Online Store 2.0?"
},
{
"type":"richtext",
"id":"answer",
"label":"Answer",
"default":"<p>Yes, our theme is fully compatible and supports Sections on every page.</p>"
}
]
}
],
"presets": [
{
"name": "5 - FAQs",
"blocks": [
{
"type": "faqs"
},
{
"type": "faqs"
}
]
}
]
}
{% endschema %}
<style>
#faq h3 { background:{{section.settings.sec-title-bg}}; color:{{section.settings.sec-title}}; }
</style>
You can add a link to text if your collapsible has this option
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Thank you. This doesn't appear to be an option - the text input field for each FAQ is very basic, with no option to for bold, justification, links etc. I'm wondering if there's a workaround for this to include links?
You can try to check if your theme has the option to add a Collapsible content section instead of using the FAQs section.
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Thanks, I'll look into it. Is this something I would find in this area to indicate that it's possible with my theme?
Hi @ribc24
As I said it's a small change in code can you track down code for the collapsible if no then I can help you track it then you can send me code and I will fix it for you
can you track down the code for accordion and provide me the file I will help you fix it it's a small change honestly it will be fixed
Hello, I have the code for the FAQ page below. Not sure if this is where it's located?
Now replace this code and you will be able to add link text from the frontend.
<div class="content-indent {{ section.settings.top-offeset}}">
{% if section.settings.section_cov %}<div class="section-cover" style="background-color:{{section.settings.sec_bg_clr}};">{% endif%}
<div class="{% unless section.settings.section_width %}page-width default-page{% else %} fullwidth-{{section.id}}{% endunless %}" style="margin-top: -6rem;">
{%- if section.settings.title != blank or section.settings.subtitle != blank -%}
<div class="sec-ttl {{ settings.title_align}} wow fadeIn">
<h3 class="h3">{{ section.settings.title }}</h3>
{%- if section.settings.subtitle != blank -%}<span>{{section.settings.subtitle}}</span>{%- endif -%}
</div>
{% endif %}
<div id="faq" class="{% if section.settings.enable_acc %}accor{% else %}no-accor{% endif %}{% if section.settings.enable_narrow %} narrow m_auto{% endif %}">
{% for block in section.blocks limit: section.blocks.size%}
{% if block.type == 'faqsection' %}
{% if block.settings.sectiontitle != blank %}
<h3>{{block.settings.sectiontitle}}</h3>
{% endif %}
{% endif %}
{% if block.type == 'faqs' %}
<div class="faq-body">
<h4 class="p_ttl {{section.settings.acc_style}} m0">{{ block.settings.question}} </h4>
<div id="{{ block.id }}" class="p_con">
{{ block.settings.answer}}
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% if section.settings.section_cov %}</div> {% endif %}
</div>
<style>
.p_ttl{ color:{{section.settings.questions}}; border-bottom:1px solid {{section.settings.borders}}; }
.p_con{color:{{section.settings.answers}};}
.p_ttl:before {color:{{section.settings.icons}}; }
.fullwidth-{{section.id}} { padding-left:{{ section.settings.pad-mbl}}px; padding-right:{{ section.settings.pad-mbl}}px; }
@media only screen and (min-width: 768px){
.fullwidth-{{section.id}} { padding-left:{{ section.settings.pad-desk}}px; padding-right:{{ section.settings.pad-desk}}px; }
}
</style>
{% schema %}
{
"name": "FAQ",
"settings": [
{
"type": "textarea",
"id": "title",
"label": "Heading",
"default": "Heading",
"info":"Use <strong>text here</strong> to make headings bold"
},
{
"type": "textarea",
"id": "subtitle",
"label": "Sub Heading",
"default": "Describe your products, collection, content etc..."
},
{
"type": "paragraph",
"content":"Section==="
},
{
"type": "select",
"id": "top-offeset",
"label": "Top OffSet",
"default": "default",
"options": [
{
"value": "default",
"label": "Default"
},
{
"value": "small",
"label": "Small"
},
{
"value": "none",
"label": "None"
}
]
},
{
"type":"checkbox",
"id":"section_width",
"label":"Fullwidth?",
"default": false
},
{
"type": "paragraph",
"content": "Left/Right Padding for Fullwidth ==="
},
{
"type": "range",
"id": "pad-desk",
"label": "Desktop",
"default": 55,
"min": 0,
"max": 100,
"step": 1
},
{
"type": "range",
"id": "pad-mbl",
"label": "Mobile",
"default": 15,
"min": 0,
"max": 15,
"step": 1
},
{
"type": "checkbox",
"id": "section_cov",
"label": "Add Background?",
"default": false
},
{
"type": "color",
"id": "sec_bg_clr",
"label": "Background",
"default":"#fafafa",
"info":"select light color"
},
{
"type": "checkbox",
"id": "enable_acc",
"label": "Enable Accordion?",
"default": false
},
{
"type": "select",
"id": "acc_style",
"label": "Accordion icons",
"default": "icons_1",
"options": [
{
"value": "icons_1",
"label": "Plus/Minus"
},
{
"value": "icons_2",
"label": "Up/Down Arrows"
}
]
},
{
"type": "checkbox",
"id": "enable_narrow",
"label": "Narrow width?",
"default": false
},
{
"type": "color",
"id": "sec-title-bg",
"label": "Section Title Background",
"default": "#333"
},
{
"type": "color",
"id": "sec-title",
"label": "Section Title",
"default": "#eee"
},
{
"type": "color",
"id": "questions",
"label": "Questions",
"default": "#444"
},
{
"type": "color",
"id": "answers",
"label": "Answers",
"default": "#444"
},
{
"type": "color",
"id": "icons",
"label": "Icons",
"default": "#333"
},
{
"type": "color",
"id": "borders",
"label": "Borders",
"default": "#eee"
}
],
"blocks":[
{
"type": "faqsection",
"name": "Section Title",
"settings": [
{
"type": "text",
"id": "sectiontitle",
"label": "Section Title"
}
]
},
{
"type":"faqs",
"name":"FAQs",
"settings":[
{
"type":"text",
"id":"question",
"label":"Question",
"default":"Is Optimal compatible with Shopify Online Store 2.0?"
},
{
"type":"richtext",
"id":"answer",
"label":"Answer",
"default":"Yes, our theme is fully compatible and supports Sections on every page."
}
]
}
],
"presets": [
{
"name": "5 - FAQs",
"blocks": [
{
"type": "faqs"
},
{
"type": "faqs"
}
]
}
]
}
{% endschema %}
<style>
#faq h3 { background:{{section.settings.sec-title-bg}}; color:{{section.settings.sec-title}}; }
</style>
Hopefully, it will help you. If yes then Please don't forget to hit Like and Mark it as the solution!
Thank you. When trying to replace the code I'm getting the following error:
"Invalid block 'faqs': setting with id="answer" default is invalid richtext: All top level nodes must be '<p>', '<ul>', '<ol>' or '<h1>'-'<h6>' tags"
Do you have any ideas why this may be?
This is an accepted solution.
Sorry try this one.
<div class="content-indent {{ section.settings.top-offeset}}">
{% if section.settings.section_cov %}<div class="section-cover" style="background-color:{{section.settings.sec_bg_clr}};">{% endif%}
<div class="{% unless section.settings.section_width %}page-width default-page{% else %} fullwidth-{{section.id}}{% endunless %}" style="margin-top: -6rem;">
{%- if section.settings.title != blank or section.settings.subtitle != blank -%}
<div class="sec-ttl {{ settings.title_align}} wow fadeIn">
<h3 class="h3">{{ section.settings.title }}</h3>
{%- if section.settings.subtitle != blank -%}<span>{{section.settings.subtitle}}</span>{%- endif -%}
</div>
{% endif %}
<div id="faq" class="{% if section.settings.enable_acc %}accor{% else %}no-accor{% endif %}{% if section.settings.enable_narrow %} narrow m_auto{% endif %}">
{% for block in section.blocks limit: section.blocks.size%}
{% if block.type == 'faqsection' %}
{% if block.settings.sectiontitle != blank %}
<h3>{{block.settings.sectiontitle}}</h3>
{% endif %}
{% endif %}
{% if block.type == 'faqs' %}
<div class="faq-body">
<h4 class="p_ttl {{section.settings.acc_style}} m0">{{ block.settings.question}} </h4>
<div id="{{ block.id }}" class="p_con">
{{ block.settings.answer}}
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% if section.settings.section_cov %}</div> {% endif %}
</div>
<style>
.p_ttl{ color:{{section.settings.questions}}; border-bottom:1px solid {{section.settings.borders}}; }
.p_con{color:{{section.settings.answers}};}
.p_ttl:before {color:{{section.settings.icons}}; }
.fullwidth-{{section.id}} { padding-left:{{ section.settings.pad-mbl}}px; padding-right:{{ section.settings.pad-mbl}}px; }
@media only screen and (min-width: 768px){
.fullwidth-{{section.id}} { padding-left:{{ section.settings.pad-desk}}px; padding-right:{{ section.settings.pad-desk}}px; }
}
</style>
{% schema %}
{
"name": "FAQ",
"settings": [
{
"type": "textarea",
"id": "title",
"label": "Heading",
"default": "Heading",
"info":"Use <strong>text here</strong> to make headings bold"
},
{
"type": "textarea",
"id": "subtitle",
"label": "Sub Heading",
"default": "Describe your products, collection, content etc..."
},
{
"type": "paragraph",
"content":"Section==="
},
{
"type": "select",
"id": "top-offeset",
"label": "Top OffSet",
"default": "default",
"options": [
{
"value": "default",
"label": "Default"
},
{
"value": "small",
"label": "Small"
},
{
"value": "none",
"label": "None"
}
]
},
{
"type":"checkbox",
"id":"section_width",
"label":"Fullwidth?",
"default": false
},
{
"type": "paragraph",
"content": "Left/Right Padding for Fullwidth ==="
},
{
"type": "range",
"id": "pad-desk",
"label": "Desktop",
"default": 55,
"min": 0,
"max": 100,
"step": 1
},
{
"type": "range",
"id": "pad-mbl",
"label": "Mobile",
"default": 15,
"min": 0,
"max": 15,
"step": 1
},
{
"type": "checkbox",
"id": "section_cov",
"label": "Add Background?",
"default": false
},
{
"type": "color",
"id": "sec_bg_clr",
"label": "Background",
"default":"#fafafa",
"info":"select light color"
},
{
"type": "checkbox",
"id": "enable_acc",
"label": "Enable Accordion?",
"default": false
},
{
"type": "select",
"id": "acc_style",
"label": "Accordion icons",
"default": "icons_1",
"options": [
{
"value": "icons_1",
"label": "Plus/Minus"
},
{
"value": "icons_2",
"label": "Up/Down Arrows"
}
]
},
{
"type": "checkbox",
"id": "enable_narrow",
"label": "Narrow width?",
"default": false
},
{
"type": "color",
"id": "sec-title-bg",
"label": "Section Title Background",
"default": "#333"
},
{
"type": "color",
"id": "sec-title",
"label": "Section Title",
"default": "#eee"
},
{
"type": "color",
"id": "questions",
"label": "Questions",
"default": "#444"
},
{
"type": "color",
"id": "answers",
"label": "Answers",
"default": "#444"
},
{
"type": "color",
"id": "icons",
"label": "Icons",
"default": "#333"
},
{
"type": "color",
"id": "borders",
"label": "Borders",
"default": "#eee"
}
],
"blocks":[
{
"type": "faqsection",
"name": "Section Title",
"settings": [
{
"type": "text",
"id": "sectiontitle",
"label": "Section Title"
}
]
},
{
"type":"faqs",
"name":"FAQs",
"settings":[
{
"type":"text",
"id":"question",
"label":"Question",
"default":"Is Optimal compatible with Shopify Online Store 2.0?"
},
{
"type":"richtext",
"id":"answer",
"label":"Answer",
"default":"<p>Yes, our theme is fully compatible and supports Sections on every page.</p>"
}
]
}
],
"presets": [
{
"name": "5 - FAQs",
"blocks": [
{
"type": "faqs"
},
{
"type": "faqs"
}
]
}
]
}
{% endschema %}
<style>
#faq h3 { background:{{section.settings.sec-title-bg}}; color:{{section.settings.sec-title}}; }
</style>
Excellent! That worked. Thank you so much for your help, I really appreciate it.
Gimme a like then 😅
Done! Sorry, I don't know how these things work 😅 thanks again
We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024