CMS Development

alvarofranz
Contributor

How to hide a module field so it never shows in the editor UI

SOLVE

I have my reasons to ALWAYS hide a field in the editor UI, but I don't see any option to do this.

 

Reading the docs, I came up with a "hack" to do this, which would be:

 

 

"visibility" : {
"controlling_field_path" : "whatever_other_field",
"controlling_value_regex" : "some-random-string-that-is-very-weird-86482",
"operator" : "EQUAL"
}

 

 

This will hide the field unless the value of "whatever_other_field" is "some-random-string-that-is-very-weird-86482".

 

But I'm not happy with this solution.

 

I wonder why there isn't a simple "hidden": true property.

 

Any other approach that is not so hacky?

0 Upvotes
1 Accepted solution
amwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

How to hide a module field so it never shows in the editor UI

SOLVE

Hi @alvarofranz ,

You can set the module parameter "locked" to true to hide it from the editor.

 

[
 {
  "name": "button_text",
  "label": "Button text",
  "type": "text"
  "locked": true
 }
]

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developer at Lynton

Learn HubL | Get Marketing Insights

View solution in original post

2 Replies 2
amwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

How to hide a module field so it never shows in the editor UI

SOLVE

Hi @alvarofranz ,

You can set the module parameter "locked" to true to hide it from the editor.

 

[
 {
  "name": "button_text",
  "label": "Button text",
  "type": "text"
  "locked": true
 }
]

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developer at Lynton

Learn HubL | Get Marketing Insights

himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

How to hide a module field so it never shows in the editor UI

SOLVE

Hello @alvarofranz 

There is no built-in way to hide a module field in HubSpot. The workaround you mentioned is the only way to do it.  Or You can use a CSS selector to hide the field from the editor UI. You can use a JavaScript function to hide the field from the editor UI.



Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes