Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Hide standard elements

Vote:
 

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!

#199381
Nov 26, 2018 8:53
Vote:
 
#199382
Nov 26, 2018 9:49
Vote:
 

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.

#199383
Nov 26, 2018 9:55
Vote:
 

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.

#199385
Edited, Nov 26, 2018 10:18
Vote:
 

Awesome, thanks a bunch!

#199390
Nov 26, 2018 11:32
Vote:
 

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.

#199723
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.