How can I hide empty metafields on FAQ pages in Blockshop theme?

How can I hide empty metafields on FAQ pages in Blockshop theme?

Novader
Visitor
2 0 0

I am currently using the Blockshop theme and have several different FAQ pages for various types of products. I am utilizing page.faq.json and metafields with collapsible rows to design these pages. Some FAQ pages have 10 questions and others only have 5; how can I get the empty metafields to not show up on the FAQ pages? 

 

Attached is example of the problem I'm running into:

IMG_5555.jpg

Replies 3 (3)

Guleria
Shopify Partner
4057 797 1146

Hello @Novader ,

 

Find it code and make it conditional.

like this:

{% if product.metafields.custom.your_metafield != blank %}
  <p>Your metafield value: {{ product.metafields.custom.your_metafield }}</p>
{% endif %}

 

Thanks

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
Novader
Visitor
2 0 0

Where should this code be placed within the page's coding?

Guleria
Shopify Partner
4057 797 1146

 

No need to place this code.
This code was just for demonstration.
You need to manually find the existing code in the theme files and wrap each metafield with  if condition as I did in the example. 

 

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder