2

I have created a custom field type and it's working good.

Here is the screenshot of how its looks in core database. All i filled in for template field type Template is Assembly and Class fields.

enter image description here

Here is the screenshot of sitecore's default date field type.

enter image description here

Like you see the difference, i am not using "Control" field for my custom field type and sitecore default field is not using Assembly and Class fields.

So, my questions are

  • what's the use of "Control" Field?
  • How sitecore default date field working with out "Assembly" and "Class" fields?
1
  • The Control field specifies the interface that will be exposed to the user. In your case, it should be the date picker. Not sure what you mean by "working without Assembly and class". It might just be storing the value entered in date format. Not sure what you mean by "How it's working in background".
    – DougCouto
    Dec 5, 2016 at 11:58

1 Answer 1

4

In Sitecore configuration you can find <controlSources> section. It contains all the namespaces Sitecore parses when it looks for content:ClassName in a field definition (like Date in your example).

That's why Sitecore finds Sitecore.Web.UI.WebControls.Date class and uses it for the DateTime field.

One good example of how this can be extended is in Sitecore.Buckets.config:

<controlSources>
  <source mode="on" prefix="contentExtension" namespace="Sitecore.Buckets.FieldTypes" assembly="Sitecore.Buckets" />
  <source mode="on" namespace="Sitecore.Buckets.Controls" assembly="Sitecore.Buckets"/>
</controlSources>

prefix="contentExtension" part says that field definition will have another prefix instead of the default content. So if you check Multlilist with Search field, you will see there contentExtension:BucketList value of the Control field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.