Sunday, 17 September 2017

Create custom ContentEditor Field in Sitecore?

First of all, I would like to explain about Content Editor fields in Sitecore.

So let's start, while creating a template in Sitecore we require giving field type like:
SingleLine Text
Rich Text
DateTime
Droplist
Multiline Text
etc.

Now sometimes content editor ask developers for custom Content Editor Fields in Sitecore.
So with this blog, I will create custom content Editor Field by making a replica of existing field types.

 So First go to the place where all the existing content editor fields are placed in Sitecore that mean Core Database.
sitecore-field-type-tree



Now Create your own custom field Directory at /sitecore/system/Field types where will put our customfield datatype item.





After creating custom field directory now it's time to create customField Datatype item at /sitecore/system/Field types/CustomField



sitecore-custom-field-tree




and given the assembly and class name of custom FieldDatatype as above.

Here is the code snapshot where we inherited the existing Sitecore field type item

sitecore-custom-field-class



Now come back to Master Database and on template uses this custom field datatype.


sitecore custom field type


And yes we successfully created a replica of the existing field type.

sitecore-custom-field




Now it's on you which type of custom field we wanted to implement.




No comments:

Post a Comment