# Choice in Custom Module not recognizing selected vale, defaults to final else statement

**URL:** <https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-vale-defaults-to-final-else-statement/7833>\
**Category:** CMS Development\
**Created:** [February 15, 2018, 4:41pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-vale-defaults-to-final-else-statement/7833 "2018-02-15T16:41:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![josephLayden](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/josephlayden/32/68653_2.png) [@josephLayden](https://community.hubspot.com/u/josephLayden)\
**Post date:** [February 15, 2018, 4:41pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-vale-defaults-to-final-else-statement/7833/1 "2018-02-15T16:41:02Z")

</div>

```auto
{% choice "brand" label="Select a brand", value='MPG', choices='MPG, MPGS, MP, RM, EXP', export_to_template_context="True" %}

{% if widget.brand == "MPG" %} 

 <!-- logo -->
 <nav id="nav">
 <a href="{{ widget.mpg_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.mpg_logo.src }}" width="{{ widget.mpg_logo.width }}" height="{{ widget.mpg_logo.height }}" alt="{{ widget.mpg_logo.alt }}" title="{{ widget_data.brand.value }}">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% elif widget.brand == "MPGS" %} 

 <!-- logo -->
 <nav id="nav">
 <a href="{{ widget.mpgs_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.mpgs_logo.src }}" width="{{ widget.mpgs_logo.width }}" height="{{ widget.mpgs_logo.height }}" alt="{{ widget.mpgs_logo.alt }}" title="{{ widget_data.department.value }}">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% elif widget.brand == "MP" %} 

 <!-- logo -->
 <nav id="nav">
 <a href="{{ widget.mp_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.mp_logo.src }}" width="{{ widget.mp_logo.width }}" height="{{ widget.mp_logo.height }}" alt="{{ widget.mp_logo.alt }}" title="{{ widget_data.brand.value }}">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% elif widget.brand == "RM" %} 

 <!-- logo -->
 <nav id="nav">
 <a href="{{ widget.rm_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.rm_logo.src }}" width="{{ widget.rm_logo.width }}" height="{{ widget.rm_logo.height }}" alt="{{ widget.rm_logo.alt }}" title="{{ widget_data.brand.value }}">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% else %}

<!-- logo -->
 <nav id="nav">
 <a href="{{ widget.rm_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.rm_logo.src }}" width="{{ widget.rm_logo.width }}" height="{{ widget.rm_logo.height }}" alt="{{ widget.rm_logo.alt }}" title="{{ widget_data.brand.value }}">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% endif %}

```

Im trying to create a header for multiple brands within an organization. The user would select the brand from a dropdown in the UI, rendering the correct header and logo. Currently the module always renders the markup in the final else statement and does not respect the user selection in the UI

---

<div class="post-metadata">

**Author:** ![John](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/john/32/43512_2.png) [@John](https://community.hubspot.com/u/John)\
**Post date:** [February 16, 2018, 1:22pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-vale-defaults-to-final-else-statement/7833/2 "2018-02-16T13:22:43Z")

</div>

There is no need to code a choice module in a custom module. Just use the custom module’s native choice field.

 ![Screen Shot 2018-02-16 at 8.16.09 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/e/5e3b8e48de1431279b5ef4865ddb8478beda08f9.png)  
on create custom module page in design manager

If you decide to use a hubl in the design manager instead of a custom module, then replace your code

`{{ widget.brand }}`

with

`{{ widget_data.brand.value }}`

---

<div class="post-metadata">

**Author:** ![josephLayden](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/josephlayden/32/68653_2.png) [@josephLayden](https://community.hubspot.com/u/josephLayden)\
**Post date:** [February 16, 2018, 2:18pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-vale-defaults-to-final-else-statement/7833/3 "2018-02-16T14:18:34Z")

</div>

How do I use markup and hubl within the custom module’s choice field UI? Can i only save a string? When I move this to a hubl module out of the custom module the choice works, but I lose the custom module inputs. Can that be retrieved with hubl?

```auto
{% choice "brand" label='Select a brand header to begin', choices='MPG, MPGS, RM, MP, EXP', export_to_template_context='True' %}

{% if widget_data.brand.value == 'MPG' %}

 <!-- logo -->
 <nav id="nav">
 <a href="https://www.manpowergroup.com" target="_blank">
 <img id="logo-normal" src="https://cdn2.hubspot.net/hubfs/2942250/WEF/Email_Confirmation/MPG_BE_Logo_SS_HOR_MC_RGB_REG.png">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% elif widget_data.brand.value == 'MPGS' %} 

 <!-- logo -->
 <nav id="nav">
 <a href="https://www.manpowergroupsolutions.com" target="_blank">
 <img id="logo-normal" src="https://cdn2.hubspot.net/hubfs/2942250/WEF2018_FollowUp_Email/shared/logos-2x/manpowergroup-solutions-300x62.png">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% elif widget_data.brand.value == 'MP' %} 

 <!-- logo -->
 <nav id="nav">
 <a href="https://www.manpower.com" target="_blank">
 <img id="logo-normal" src="https://cdn2.hubspot.net/hubfs/2942250/WEF2018_FollowUp_Email/shared/logos-2x/manpower-268x52.png">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% elif widget_data.brand.value == 'RM' %} 

 <!-- logo -->
 <nav id="nav">
 <a href="https://www.right.com" target="_blank">
 <img id="logo-normal" src="https://cdn2.hubspot.net/hubfs/2942250/RM_BE_Logo_SS_HOR_MC_REG_RGB.png">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% else %} 

 <!-- logo -->
 <nav id="nav">
 <a href="https://www.experis.com" target="_blank">
 <img id="logo-normal" src="https://cdn2.hubspot.net/hubfs/2942250/EXPERIS-IT/images/experis-logo.svg">
 </a>
 </nav>
 <div id="nav-spacer"></div>

{% endif %}

```
