CmsControls Development for 7.0

Author:JonK
Last Updated:December 21, 2022 10:57 AM

CmsControl objects are the primary building blocks for the v7 Worstation. Their purpose is to serve as public properties in Model classes.

In the past they were called CmsFormControls, and were primarily used on Tabs that had structured fields, like Properties or any Data Site.  For version 7, we are leaning on these elements more heavily as a framework to standardize and simplify the implementaiton of the new Workstation.

 

Anatomy of a CmsControl

CmsControl objects are implemented in four parts:

  • Model that inherits (directly, or indirectly) from CmsControlBase
  • Hydrator 
  • Display and/or Editor Template
  • Supporting JavaScript module
CmsControlBase

CmsControlBase is an abstract class that all CmsControls inherit from. Through this class every CmsControl has the following properties:

  • object Value
  • bool SupportsMultiEdit
  • bool IsMultiEdit
  • bool Visible
  • string DefaultInitFunction

In addition, it implements three interfaces, which also provide CmsControls with the following:

  • IHasExtractors
    • Func<XElement> ExtractDocument
    • Func<string, string> ExtractXPath
  • IHasHydrator
    • Func<IDictionary<string, object>, IModelHydrator> Hydrator
  • IHasHelp
    • IHelpControl Help

Finally, all CmsControlBase objects are "inherantly decorated" with two annotations, which provide support for default client-side javascript behaviors. 

  • ClientSideValidator
  • ClientSideMetadata

 

Available CmsControls

View Screenshots of Controls here.

  • Input-type Controls
    • CmsCheckableItems
    • CmsCKEditor
    • CmsContentPicker (TBD)
    • CmsCustomUrlChecker
    • CmsCustomUrlCollection
    • CmsDate
    • CmsDateTime
    • CmsDropdown
    • CmsFilePicker
    • CmsFileUpload
    • CmsGeographicPoint (TBD)
    • CmsHiddenInput
    • CmsLinkItemCollection
      • CmsLinkBuilder
      • CmsMultiFilePicker (TBD)
    • CmsNavPicker
    • CmsRecurringDateTime (TBD)
    • CmsSuggestListBox
    • CmsTagsPicker
    • CmsTextInput
      • CmsTextAreaControl
    • CmsViewDropdown
    • CmsViewPicker
  • Label/Message-type Controls
    • CmsBubbleMessage
    • CmsHeader 
    • CmsNotice<T>
    • CmsSimpleHelp
    • CmsSpan
    • CmsStaticHtml
top