# Editable Image from HubDB

**URL:** <https://community.hubspot.com/t/editable-image-from-hubdb/68000>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [October 27, 2022, 10:42am UTC](https://community.hubspot.com/t/editable-image-from-hubdb/68000 "2022-10-27T10:42:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IDuspara](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@IDuspara](https://community.hubspot.com/u/IDuspara)\
**Post date:** [October 27, 2022, 10:42am UTC](https://community.hubspot.com/t/editable-image-from-hubdb/68000/1 "2022-10-27T10:42:54Z")

</div>

I have the following problem. Created a custom module where you can pick the row from the hubDB table. The row has a Title and Image column. I want to display the row data in template but also has the option to change the default Image inside the Editor.

---

<div class="post-metadata">

**Author:** ![Bryantworks](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bryantworks/32/94963_2.png) [@Bryantworks](https://community.hubspot.com/u/Bryantworks)\
**Post date:** [October 27, 2022, 1:46pm UTC](https://community.hubspot.com/t/editable-image-from-hubdb/68000/2 "2022-10-27T13:46:30Z")

</div>

Hey @IDuspara,

I believe for your module, you’d essentially clone your custom code row for an image, but using some ifelse logic give the user to toggle a new image in place of the image you’ve selected from the row.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [October 27, 2022, 5:17pm UTC](https://community.hubspot.com/t/editable-image-from-hubdb/68000/3 "2022-10-27T17:17:50Z")

</div>

Add an image field to your module and then as @Bryantworks said you’d write an if else statement. The following is a simple example of such an if statement:

```lia-code-sample
{% if module.image.src %}
 <img src="{{ module.image.src }}" />
{% else %}
 <img src="{{ module.hubdbrow_field.columns.column_name.url }}" />
{% endif %}

```

---

<div class="post-metadata">

**Author:** ![IDuspara](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@IDuspara](https://community.hubspot.com/u/IDuspara)\
**Post date:** [October 28, 2022, 7:03am UTC](https://community.hubspot.com/t/editable-image-from-hubdb/68000/4 "2022-10-28T07:03:30Z")

</div>

The problem is that the field is dynamic and there can be 1 or 10 images. I thought that it`s posible to create dynamic fields.
