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
3166 618 887

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

- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on store Hire me. - Email: guleriathakur43@gmail.com - Skype: navrocks1 ,
- Try GEMPAGES a great page builder
- Support me PayPal
Novader
Visitor
2 0 0

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

Guleria
Shopify Partner
3166 618 887

 

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. 

 

- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on store Hire me. - Email: guleriathakur43@gmail.com - Skype: navrocks1 ,
- Try GEMPAGES a great page builder
- Support me PayPal