Hide Quote comments block if it's empty

dmytro
Participant

 

Hello

 

How it's possible to hide Quote comments block if it's empty (see screenshot)

 

screenshot-71.png

 

 

In code it looks like this:

 

<h2 class="comments-title text-center">Comments</h2>
{% module "comments" label="Comments" path="@hubspot/rich_text" extra_classes="comments-block" html={{ module_defaults.comments }} %}

 

 

2 Replies 2
arlogilbert
Contributor

Just wrap the module tag with this:

 

{% if QUOTE.hs_comments|length > 0 %}
<h2 class="comments-title text-center">Comments</h2>
{% module "comments" label="Comments" path="@hubspot/rich_text" extra_classes="comments-block" html={{ module_defaults.comments }} %}
{% endif %}

 

dmytro
Participant

Thank you @arlogilbert 

This is what I looking for!

0 Upvotes