# If else when inputs in a groups doesn't have values

**URL:** <https://community.hubspot.com/t/if-else-when-inputs-in-a-groups-doesnt-have-values/69274>\
**Category:** CMS Development\
**Created:** [November 15, 2022, 11:08am UTC](https://community.hubspot.com/t/if-else-when-inputs-in-a-groups-doesnt-have-values/69274 "2022-11-15T11:08:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RJChauhan](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@RJChauhan](https://community.hubspot.com/u/RJChauhan)\
**Post date:** [November 15, 2022, 11:08am UTC](https://community.hubspot.com/t/if-else-when-inputs-in-a-groups-doesnt-have-values/69274/1 "2022-11-15T11:08:56Z")

</div>

```lia-code-sample
{% if module.section_title %}
<div class="section-title text-center pb-lg-5 pb-4">
{% if module.section_title.heading %}
<h2 class="heading mt-0 {% if module.section_title.title_para %} mb-3 {% else %} mb-0 {% endif %}">
{{ module.section_title.heading }}
</h2>
{% endif %}
{% if module.section_title.title_para %}
<p class="mx-auto my-0 p-0">
{{ module.section_title.title_para }}
</p>
{% endif %}
</div>
{% endif %}

```

I want to hide all the html when both fields **heading** and **title\_para** are empty or doesn’t have value currently these both are inside a group **section\_title.**  
I want to hide complete htlm\*\*“\<div class=“section-title text-center ss pb-lg-5 pb-4”\>…\</div\>”\*\* only when both are empty or doesn’t have value

---

<div class="post-metadata">

**Author:** ![albertsg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/albertsg/32/99473_2.png) [@albertsg](https://community.hubspot.com/u/albertsg)\
**Post date:** [November 15, 2022, 11:30am UTC](https://community.hubspot.com/t/if-else-when-inputs-in-a-groups-doesnt-have-values/69274/2 "2022-11-15T11:30:13Z")

</div>

Hello @RJChauhan, you almost had it 😁

To make it work as intended, change your first IF condition to not look at the group but to the individual items.

This should work as you want:

```lia-code-sample
{% if module.section_title.heading or module.section_title.title_para %}
<div class="section-title text-center pb-lg-5 pb-4">
{% if module.section_title.heading %}
<h2 class="heading mt-0 {% if module.section_title.title_para %} mb-3 {% else %} mb-0 {% endif %}">
{{ module.section_title.heading }}
</h2>
{% endif %}
{% if module.section_title.title_para %}
<p class="mx-auto my-0 p-0">
{{ module.section_title.title_para }}
</p>
{% endif %}
</div>
{% endif %}

```
