Shopify themes, liquid, logos, and UX
I have 400+ products. Each product description is formatted as follows:
<h2>Product leader title</h2>
<p>content paragraph 1</p>
<p>content paragraph 2</p>
<h2>About the XXXX product </h2>
<p>content paragraph 1</p>
<p>content paragraph 2</p>
<h2>Size Guide</h2>
<table>table content</table>
<table>table content</table>
The "Product leader title" H2 and the "About the XXXX product" H2 are different for each product. The Size Guide H2 is always "<h2>Size Guide</h2>".
The goal is to convert the product description into 3 collapsible rows (accordion):
I prefer NOT to install an app and go through 400 pages to re-do the description. Is there a code solution to grab the <h2>...</H2> content and use it as the content in a collapsible row?
I have tried the split filter but I could only get that to work for two of the three H2 content sections.
Any suggestions?
Hello @okavango ,
It's possible but needs customization.
If you are good with code first change h2 as Accordion title and then content which is after it as Accordion content.
After that you can write a script which will perform the action on click of titles to show/hide the items.
Thanks
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025