CMS Development

ellimccale
Participant

Default to "Edit Separately" for Padding in Custom Modules

SOLVE

Hi there,

 

Is there an option for the Spacing field to default to "Edit Separately" for padding? This is the initial padding interface:

 

ellimccale_1-1674264102642.png

 

I would prefer it to default to this:

 

ellimccale_0-1674264078479.png

 

Secondly, is it possible to disable left and right padding? I hazarded a guess in fields.json, but it throws an error in the CLI:

 

 

{
  "label": "Spacing",
  "name": "spacing",
  "type": "spacing",
  "visibility": {
    "hidden_subfields": {
      "margin": true,
      "padding": {
        "left": true
        "right": true
      }
    }
  }
}

 

 

Thanks!

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

Default to "Edit Separately" for Padding in Custom Modules

SOLVE

If you set a default for any of the padding values (even if the value is just null) it'll default to the Edit Seperately state.

 

You can't completely hide select values in padding or margin but using limits you can set their min and max to 0 to disable them (note: limits requires you to include a "units" value).

 

{
 "name": "spacing",
 "label": "Spacng",
 "required": false,
 "locked": false,
 "type": "spacing",
 "inline_help_text": "",
 "help_text": "",
 "visibility": {
   "hidden_subfields": {
     "margin": true
   }
 },
 "limits": {
  "padding": {
    "left": {"max": 0, "min": 0, "units": ["px"]},
    "right": {"max": 0, "min": 0, "units": ["px"]}
  }
 },
 "default": {
   "padding": {
     "top": {
       "value": 0,
       "units": "px"
     },
     "right": {
       "value": 0,
       "units": "px"
     },
     "bottom": {
       "value": 0,
       "units": "px"
     },
     "right": {
       "value": 0,
       "units": "px"
     }
  }
 }
}

 

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

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

View solution in original post

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

Default to "Edit Separately" for Padding in Custom Modules

SOLVE

If you set a default for any of the padding values (even if the value is just null) it'll default to the Edit Seperately state.

 

You can't completely hide select values in padding or margin but using limits you can set their min and max to 0 to disable them (note: limits requires you to include a "units" value).

 

{
 "name": "spacing",
 "label": "Spacng",
 "required": false,
 "locked": false,
 "type": "spacing",
 "inline_help_text": "",
 "help_text": "",
 "visibility": {
   "hidden_subfields": {
     "margin": true
   }
 },
 "limits": {
  "padding": {
    "left": {"max": 0, "min": 0, "units": ["px"]},
    "right": {"max": 0, "min": 0, "units": ["px"]}
  }
 },
 "default": {
   "padding": {
     "top": {
       "value": 0,
       "units": "px"
     },
     "right": {
       "value": 0,
       "units": "px"
     },
     "bottom": {
       "value": 0,
       "units": "px"
     },
     "right": {
       "value": 0,
       "units": "px"
     }
  }
 }
}

 

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

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
ellimccale
Participant

Default to "Edit Separately" for Padding in Custom Modules

SOLVE

Perfect - works well enough for my uses. Thank you!

0 Upvotes