Conditional options possible?

Hi everybody,

I was wondering if there is a possibility to have conditional options in your custom module. For example I would like to do something like:

{% if boolean %}// add choicefield to my editable options{% endif %}

Is there a way to do this?

Thanks. :slightly_smiling_face:

When you create a custom module, you can add a boolean field:


Add boolean field

After you name it, you can create a HubL conditional like this:

{% if widget.your_new_boolean %}
<!-- HTML to show when checked -->
{% endif %}

I am aware of this. However I’m not trying to show and hide the content on the front end but on the editor side. For example when I have a boolean which says “Show image” and is checked I want another option to appear in the editor which shows me the image options.

Ah, I understand what you mean now. Currently the there is no way to conditionally hide or show additional fields in the editor. We are aware that this is an issue and we’re looking into solutions for this.

Best,

Anthony