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.
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!
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:
{% if module.image.src %}
<img src="{{ module.image.src }}" />
{% else %}
<img src="{{ module.hubdbrow_field.columns.column_name.url }}" />
{% endif %}
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.