Templates

Content in Dynamix pages are presented using Templates. They base class for templates is Dynamix.Template, but content pages are in almost all cases derived from Dynamix.ContentTemplate.

To create a template using Dynamix Developer Tools you can add a new item from Visual Studio:

Choose Dynamix 6 - Template

In the template constructor you can define sections which are containers that can later be filled with content.

public MyTemplate()
{
    // Create a section component with the logical name Main
    var main = new FlowLayoutTemplateComponent( "Main" );

    // When editors start typing the text will be formatted using NormalTextStyle
    main.DefaultTextStyle = NormalTextStyle.Instance;

    // Add the section to this templates component list
    Components.Add( main );
}

NormalTextStyle.Instance in the code above refers to a text style object.

Presentation page

By implementing the method GetUrl you tell Dynamix which web form to load when a page based on this template is requested.

Further reading

Last updated 2015-08-12