# Default value with custom module

**URL:** <https://community.hubspot.com/t/default-value-with-custom-module/13570>\
**Category:** CMS Development\
**Tags:** email\
**Created:** [March 19, 2019, 2:57am UTC](https://community.hubspot.com/t/default-value-with-custom-module/13570 "2019-03-19T02:57:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacee](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/spacee/32/92090_2.png) [@spacee](https://community.hubspot.com/u/spacee)\
**Post date:** [March 19, 2019, 2:57am UTC](https://community.hubspot.com/t/default-value-with-custom-module/13570/1 "2019-03-19T02:57:12Z")

</div>

I made custom module on Design manager. It uses contact property and replace with default value property is not set (blank). Tried 2 implementation case but could not work.

output of code is blank.

case 1

```auto
 <td style="width: 50%; padding-right: 14px; text-align: left; font-size: 12px; padding-bottom: 30px; line-height: 1.5em;" valign=top class="k-480-col mk-padding">
 <a href="{{ contact.booking_recomended_listing_1_url|default('example.com') }}">
 <img src="{{ contact.booking_recomended_listing_1_image|default('example.jpg', true) }}" style="width: 296px; height: 180; object-fit: contain; border: none;" width="{{ widget.image_left.width }}" alt="{{ widget.image_left.alt }}">
 <h2 style="font-size: 14px; margin-top: 15px;">{{ contact.booking_recomended_listing_1_name|default('example name', true) }}</h2> 
 {{ contact.booking_recomended_listing_1_access|default('example text', true) }} 
 </a>
 </td>

```

case 2

```auto
 <td style="width: 50%; padding-left: 14px; text-align: left; font-size: 12px; padding-bottom: 30px; line-height: 1.5em;" valign=top class="k-480-col k-480-padding">
 {% if contact.booking_recomended_listing_2_url != "CONTACT.BOOKING_RECOMENDED_LISTING_2_URL" %}
 <a href="{{contact.booking_recomended_listing_2_url}}">
 <img src="{{contact.booking_recomended_listing_2_image}}" style="width: 296px; height: 180; object-fit: contain; border: none;" width="{{ widget.image_left.width }}" alt="{{ widget.image_right.alt }}">
 </a>
 <h2 style="font-size: 14px; margin-top: 15px;"><a href="{{contact.booking_recomended_listing_1_url}}">{{ contact.booking_recomended_listing_2_name }}</a></h2> 
 {{ contact.booking_recomended_listing_2_access }}
 {% else %}
 <a href="example.com">
 <img src="example.JPG" style="width: 296px; height: 180; object-fit: contain; border: none;" width="{{ widget.image_left.width }}" alt="{{ widget.image_left.alt }}">
 </a>
 <h2 style="font-size: 14px; margin-top: 15px;"><a href="example.com">example name</a></h2>
 example text
 {% endif %}
 </td>

```

---

<div class="post-metadata">

**Author:** ![DaniellePeters](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/daniellepeters/32/6115_2.png) [@DaniellePeters](https://community.hubspot.com/u/DaniellePeters)\
**Post date:** [March 19, 2019, 8:55pm UTC](https://community.hubspot.com/t/default-value-with-custom-module/13570/2 "2019-03-19T20:55:43Z")

</div>

Hey there!

Since you’re dealing with contact properties, I think your best best is to set up personalization token defaults rather than setting defaults in the HubL markup

Here is an knowledge base article that will walk you through setting those up:

[https://knowledge.hubspot.com/articles/kcs\_article/email/how-do-i-create-default-values-for-my-personalization-tokens](https://knowledge.hubspot.com/articles/kcs_article/email/how-do-i-create-default-values-for-my-personalization-tokens)

---

<div class="post-metadata">

**Author:** ![spacee](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/spacee/32/92090_2.png) [@spacee](https://community.hubspot.com/u/spacee)\
**Post date:** [March 20, 2019, 1:40am UTC](https://community.hubspot.com/t/default-value-with-custom-module/13570/3 "2019-03-20T01:40:31Z")

</div>

Thank you. Resolved with that.
