SaaS CMS has officially launched! Learn more now.

Hide standard elements



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!

Nov 26, 2018 8:53
Nov 26, 2018 9:49

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.

Nov 26, 2018 9:55

Hi Robin,

Please see my answer on this post 

Basically, you can override ListAvailable method of DefaultContentTypeAvailablilityService to filter out the elements.

Edited, Nov 26, 2018 10:18

Awesome, thanks a bunch!

Nov 26, 2018 11:32

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.

Dec 07, 2018 12:40
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.