Ektron Code Exchange Community

Ektron Exchange is a community for Ektron web site developers that allows web developers to upload and share thier code with others in the community. The exchange also provides Ektron Best Practices from Ektron's CFG (Code Factory Group) for creating and posting code samples.

  • Best Practices

    The objective of any Best Practices process is to ensure the ultimate success of a project.  In coding, the goal is to prevent errors from occurring.  The Best Practices section of the Ektron Exchange is designed for the community to share knowledge and the experience of Ektron experts to ensure that their code is implemented in a standardized, error-free fashion.

  • Creating Code
    • Code in such a way that the integration process is as simple as possible.
    • Create as detailed a help file as possible. This will make integration easier for the user of your code and could help your code rating.
    • If you choose, you can add a YouTube Video link in the code upload form for a video or screencast that’s associated with your code. The video will then display on your code’s download page. Videos are helpful to show how your code works or how it is implemented.
    • Do not upload components that are already widely available on the web.
    • Do not borrow code from similar components.
    • Your code should be contained in a single .ZIP file that contains all the files for download, help documentation and any other files (such as images). As this is the file that a user will download, make sure you have included all terms you wish the user to have.

     

     

    CFG Widget Framework

    The goal of the widget framework is to provide an extendable widget platform. A single widget can be easily extended to provide multiple data-bindable HTML views without the expense of an XML transformation.  This is achieved by separating out the widget’s three basic components of supplied data, internal data gathering and output data into distinct user controls.  It is then possible to “plug-in” different components so that new HTML views are possible with little extra effort on the part of the developer.

    The widget begins with the base widget user control that will reside within the site’s Widgets directory.  This control will contain the necessary IWidget class inheritance and a Multiview control, as all standard widgets have.  The base widget will be responsible for internal data gathering and will store any widget data passed to it from the edit mode user control.  The workflow for this widget is as follows:  It will store the data from the edit mode user control, gather any additional information from the CMS, and pass data structures to the appropriate view mode user control.  The view mode control is determined by a selection in the edit mode. It will be dynamically added to the base widget’s view mode when the widget is loaded on a page.  All supporting files for this widget will be stored within a folder structure with the same name as the widget.

    The edit mode user control will reside within the Widgets\\Edits folder and will be responsible for gathering all the relevant information that the base widget requires to collect the data structures from the CMS.  This includes the view information that the base control needs to be able to switch upon. The view information will be supplied via a dropdown menu.  An edit mode user control will be placed upon the base widget’s Edit view and will be accessed as a traditional widget. The data it collects will be passed to the base widget when the base widget’s Save button is clicked.

    The view mode user control will reside within the Widgets\\Views folder.  This control will have a Src attribute used by the base widget to pass the data that it collects to the view mode control.  The view mode control will only be responsible for data-binding the data it gets through its Src property and displaying the appropriate HTML.  Different outputs would be represented by different user controls which accept the same type of data structure but bind the data in different HTML views.  All the .ascx files that reside within the Widget’s Views folder will be available via a dropdown list in the edit mode. A reference to the View’s user control must be placed on the base widget so that it can be programmatically added when the widget’s output is rendered.

    The advantages of this method will be that lightweight data-binding tools such as asp repeater controls and asp listview controls can be utilized instead of costly XML transformations.  Adding outside HTML elements within the data-bindable controls is much easier and more “light-weight” than adding additional data to an XML structure before transformation.