Posts

Showing posts from December, 2018

Get Specific Elements Blocks from EPiServer Forms

A small extension to get the specific form elements block with all properties rather relying on   FriendlyNameInfo  with the limited set of properties. EPi Form Extensions Gist Example: Custom form element block: public   class   HiddenExternalValueElementBlock  :  HiddenElementBlockBase {     [ Display (Name =  "Enable if its a special campaign" )]      public   virtual   bool  MySpecialCampaign {  get ;  set ; }     [ Display (Name =  "Propperty 1" )]      public   virtual   bool  Property1 {  get ;  set ; }     [ Display (Name =  "Property 2" )]      public   virtual   bool  Property2 {  get ;  set ; } } Extension Methods: using  EPiServer.Core; using  EPiServer.Forms.Core; using  EPiServer.Forms.Core.Models; using  EPiServer.Forms.Helpers.Internal; using  EPiServer.Forms.Implementation.Elements; using  System.Collections.Generic; using  System.Linq; namespace  PixieDigital.EpiServer.Extensions {      public   static   class