0

i want to add accordion inside the cms block, but it is not taking

this is the code i want to add

<div id="accordion" data-mage-init='{
"accordion":{
"activate": 2,
"collapsible": true,
"openedState": "",
"multipleCollapsible": true
}}'>
<h3>Information </h3>
<div class="disp" data-role="collapsible">
<div data-role="trigger">
<i class="fas fa-angle-down"></i>
</div>
</div>
<div data-role="content"><ul>
<li><a href="#">Return Policy</a></li>
<li><a href="#">Terms and Condition</a></li>
<li><a href="#">Start a Return</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Search</a></li>
<li><a href="#">FAQ</a></li>
</ul>
</div>
</div>

after save it will become

<div id="accordion" data-mage-init="{
">
<h3>Information</h3>
<div class="disp" data-role="collapsible">
<div data-role="trigger">&nbsp;</div>
</div>
<div data-role="content">
<ul>
<li><a href="#">Return Policy</a></li>
<li><a href="#">Terms and Condition</a></li>
<li><a href="#">Start a Return</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Search</a></li>
<li><a href="#">FAQ</a></li>
</ul>
</div>
</div>
asked Jan 6, 2022 at 5:25

1 Answer 1

1

Please add phtml file in CMS block and add code in phtml file.

{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::information.phtml"}}

add phtml on below path

app/design/frontend/Your/Theme/Magneto_Theme/templates/information.phtml

Note: CMS Block not support some additional tag and script so never add code directly in CMS Block.

answered Jan 6, 2022 at 5:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.