I'm sure you could do it at runtime for the FormContainer type by following something like
https://josefottosson.se/injected-allowedtypes-availablecontenttypes-in-episerver/
https://gist.github.com/joseftw/d3f4164bbcd47b8f38e0866b31eefa44
Most likely an easier way is to go to admin view => content type tab. Select the form element that you don't want to be available for editors, click 'settings' on the content type and un-check 'Available in edit view', Save.
Propably you could create an initialization module to do this from code.
Hi Robin,
Please see my answer on this post https://world.episerver.com/forum/developer-forum/episerver-forms/thread-container/2018/7/hiding-standard-formcontainerblock/
Basically, you can override ListAvailable method of DefaultContentTypeAvailablilityService to filter out the elements.
Shameless own blog post boost: How to hide content types from editors in Episerver which you don’t own
I would say that the initialization module and setting the content type availability for editors is still simpler and safer solution as you don't need to inherit the DefaultContentTypeAvailablilityService which is in internal namespace (and could change without any notice), used in Trans solution.
You could also remove create access rights (in admin view or in intialization module) to the content and it should hide it also from editors.
Hi,
I've built a bunch of custom epiforms elements and I'd like to display only these elements when the user presses "create new form element". The standard functionality always shows the "standard elements" as well, not only my custom ones. I dont want my users to be able to access these, so im looking for a way to hide them.
I've tried doing this by css but the ID isnt unique for the surrounding div (i.e "dijit__KeyNavContainer_3"). Is there a way of doing this that im missing? Injecting javascript sounds like a bad solution to this problem.
Thanks alot!