Conditional options possible?

SOLVE
MvdLanden
Participant

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. 🙂

2 Accepted solutions

Accepted Solutions
anthonypizzurro
Solution
HubSpot Product Team

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

Add boolean fieldAdd 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 %}

View solution in original post

0 Upvotes
anthonypizzurro
Solution
HubSpot Product Team

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

View solution in original post

0 Upvotes
3 Replies 3
anthonypizzurro
Solution
HubSpot Product Team

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

Add boolean fieldAdd 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 %}

View solution in original post

0 Upvotes
MvdLanden
Participant

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.

0 Upvotes
anthonypizzurro
Solution
HubSpot Product Team

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

View solution in original post

0 Upvotes