Prevent editing in content editors

SOLVE
Occasional Contributor

Modules where "Prevent editing in content editors" is toggled are now showing in the content editor.  For example, I now see modules like the "Horizontal Spacer" in the content editor. As they are not editable, it is difficult to understand why they're now shown in the content editor. It is very messy at the moment with useless modules to the editor being shown.

 

Has anyone found a workaround for hiding these modules in the content editor?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Regular Advisor

This is used a lot for, say, global content that you'd like to appear on the page but you don't want people changing at the page level. So I could have something like this at the bottom of my posts that I don't necessarily want to hide: 

 

Shows a module that cannot be edited on the page

 

If you don't want these visible at all, what you could do is set a class "hide-in-content-editor" on modules you'd like to hide and then use the editor's body class "hs-inline-edit" to hide that. So something like: 

 

.hs-inline-edit .hide-in-content-editor { display: none; }

Or maybe hide the specific module on the modules sidebar using "hs-inline-edit" and the module ID?

 

Shows the module sidebar and the module CSS IDs

I haven't used it for this specifically but I've used the opposite to display elements in the editor that I don't want visible elsewhere (like an "Edit this module" button that's set to not display by default but set to block on the .hs-inline-edit page). 

 

I hope that helps!

 


Stephanie O'Gay Garcia

HubSpot CMS Design & Development

Website | Contact

 

If this helped, please mark it as the solution to your question, thanks!

1 Reply 1
Highlighted
Regular Advisor

This is used a lot for, say, global content that you'd like to appear on the page but you don't want people changing at the page level. So I could have something like this at the bottom of my posts that I don't necessarily want to hide: 

 

Shows a module that cannot be edited on the page

 

If you don't want these visible at all, what you could do is set a class "hide-in-content-editor" on modules you'd like to hide and then use the editor's body class "hs-inline-edit" to hide that. So something like: 

 

.hs-inline-edit .hide-in-content-editor { display: none; }

Or maybe hide the specific module on the modules sidebar using "hs-inline-edit" and the module ID?

 

Shows the module sidebar and the module CSS IDs

I haven't used it for this specifically but I've used the opposite to display elements in the editor that I don't want visible elsewhere (like an "Edit this module" button that's set to not display by default but set to block on the .hs-inline-edit page). 

 

I hope that helps!

 


Stephanie O'Gay Garcia

HubSpot CMS Design & Development

Website | Contact

 

If this helped, please mark it as the solution to your question, thanks!