# Problems with HubL if/else statement

**URL:** <https://community.hubspot.com/t/problems-with-hubl-if-else-statement/8972>\
**Category:** CMS Development\
**Created:** [May 25, 2018, 12:45pm UTC](https://community.hubspot.com/t/problems-with-hubl-if-else-statement/8972 "2018-05-25T12:45:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandyv](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sandyv/32/13631_2.png) [@Sandyv](https://community.hubspot.com/u/Sandyv)\
**Post date:** [May 25, 2018, 12:45pm UTC](https://community.hubspot.com/t/problems-with-hubl-if-else-statement/8972/1 "2018-05-25T12:45:52Z")

</div>

I’ve created a module using the if/else statement.  
I use the if/else statement to change icons. So whenever a variable is equal to ex. “starter”, the icon changes to a “S” icon. This works when there’s only ONE of the modules on a template.  
I use the module multiple times, and that is where the issue comes.  
Whenever I add another module of the same, on a template, the module underneath the first module, uses the same icon as the first module even though I changed the variable. I can see that the variable changes but the icon doesn’t change.  
Sample code:

```auto
{% if widget.type_of_plan == 'starter' %}
ICON IMAGE 1
{% elif widget.type_of_plan == 'commerce' %}
ICON IMAGE 2
{% else %}
ICON IMAGE 3
{% endif %}

```

Does anyone have a clue what is wrong? Or experienced the same?

---

<div class="post-metadata">

**Author:** ![roisinkirby](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@roisinkirby](https://community.hubspot.com/u/roisinkirby)\
**Post date:** [June 12, 2018, 9:14am UTC](https://community.hubspot.com/t/problems-with-hubl-if-else-statement/8972/2 "2018-06-12T09:14:59Z")

</div>

Hey [@Sandyv\_](https://community.hubspot.com/t5/user/viewprofilepage/user-id/62325) apologies for the delay. Are you still experiencing this roadblock? If so, could you plese post a link to the page you are working on?

---

<div class="post-metadata">

**Author:** ![Sandyv](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sandyv/32/13631_2.png) [@Sandyv](https://community.hubspot.com/u/Sandyv)\
**Post date:** [June 13, 2018, 9:54am UTC](https://community.hubspot.com/t/problems-with-hubl-if-else-statement/8972/3 "2018-06-13T09:54:20Z")

</div>

Hi,

I solved the problem. I had an issue with my images. 🙂
