How to hide default content for empty Custom Content Block on Impulse theme?

How to hide default content for empty Custom Content Block on Impulse theme?

elizklein
Visitor
2 0 0

We're using Impulse version 7.3. I have the following code used to display custom metafields from Collections. (This is working, except for the piece below)

{% if collection.metafields.custom.collection_bottom_description_1 != blank %}

{{ collection.metafields.custom.collection_bottom_description_1 }}

{% endif %}

 

BUT when they're blank, it's populating the default "This section doesn't currently include any content. Add content to this section using the sidebar."

 

If these fields are blank, I simply want these boxes to disappear, and not display this message. 

 

How can I fix this? 

Reply 1 (1)

PaulNewton
Shopify Partner
7746 679 1613

Hi @elizklein  Try either: an empty space character " ", or a dot or special hidden ascii character so the metafield is not technically blank.

Or slightly different logic 

{% if collection.metafields.custom.collection_bottom_description_1 != blank %}
 {{ collection.metafields.custom.collection_bottom_description_1 }}
{% else %}
 {%- comment %}This else has a hidden hair-width whitespace character from https://www.namecheap.com/visual/font-generator/whitespace/{% endcomment %}
  
{% endif %}

 

 

Otherwise the theme may need to be customized to change how the placholder onboarding content logic works.

 

If you need this customization then contact me by my email for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org