my goal is to create a custom field control based on a custom field, to be part of a custom content type which derives from a publishing page. Also I want the custom field control to be part of a custom page layout which is associated with my custom content type.
I followed the steps from Patrick Tisseghems book 'Inside MOSS2007', which includes the following instructions:
- Create and implementÃÂ the following classes: CustomField, CustomFieldValue, CustomFieldControl. Sign them and deploy the assembly to the GAC.
- Create a User Control Custom.ascx. Copy it to Controltemplates directory.
- Create fldtypes_custom.xml and copy to 12\TEMPLATE\XML
- Add <SafeControl /> entry to web.config
I did of all the above plus IÃÂ created a page layout in SharePoint Designer which contains an instance of my CustomFieldControl.
When IÃÂ create an instance ofÃÂ CustomPage (derived content type from Publishing Page, with extra field of type CustomField) with my custom page layout and add it to the Pages library of my Publishing site, everything seems to go fine. When i edit properties of the pageÃÂ with /Pages/Forms/EditForm.aspx I can even edit the custom field value trough the interface using mu custom field control! Everything seems to work perfectly!
View Complete Post