Products and Services
Graffiti CMS
Learn more about our simple content publishing platform.
Harvest Reporting Server
Get business intelligence tools for measuring online behavior.
Professional Services
Consulting, creative, and Web services from the people who know Community Server best.
Solutions
Telligent
Learn more about our team at Telligent.com.
 

Adding Dynamic Configuration Options

You can add dynamic configuration options to your themes to support exposing end-user theme options on the Theme Configuration page in the Community Server Control Panel. 

Site and blog themes support dynamic configuration options by defining the XML meta-data within the <DynamicConfiguration></DynamicConfiguration> node of the theme.config file (located in the root folder of the theme). 

Here is a sample theme.config file defining a single custom property:

<?xml version="1.0" encoding="utf-8" ?>
<Theme title="Theme Title" previewText="Description of this theme.">
<DynamicConfiguration>
  <propertyGroup name="Tab Name">
   <property id="property1" text="Property 1" dataType="string" />
  </propertyGroup>
</DynamicConfiguration>
</Theme>

Supported Nodes

The following nodes are supported within the theme.config file’s <DynamicConfiguration></DynamicConfiguration> node:

<propertyGroup>

Property groups represent groups of configuration properties and are generally rendered as tabs on the Theme Configuration page.  You can define property groups within the <DynamicConfiguration></DynamicConfiguration> node and support the following attributes.

  • id
  • resourceName/resourceFile/text
  • descriptionResourceName/descriptionResouceFile/descriptionText
  • orderNumber
  • visible
  • Unrecognized Attributes

<propertySubGroup>

Property sub groups represent a sub-grouping of configuration properties and are generally rendered as a heading above their associated configuration properties.  Property sub-groups can be defined within <propertyGroup></propertyGroup> nodes and support the following attributes:

  • id
  • resourceName/resourceFile/text
  • descriptionResourceName/descriptionResourceFile/descriptionText
  • orderNumber
  • visible
  • Unrecognized Attributes

<property>

Property nodes identify a single configuration property which will be rendered using a dataType-appropriate form control (overridable using the controlType attribute).  You can define properties within either <propertyGroup></propertyGroup> nodes or <propertySubGroup></propertySubGroup> nodes. They support the following attributes:

  • id
  • resourceName/resourceFile/text
  • descriptionResourceName/descriptionResourceFile/descriptionText
  • orderNumber
  • dataType
  • controlType (Custom, Bool, Int, Double, String, Date, Time, DateTime, Guid, Color, Unit, Url
  • visible
  • editable
  • defaultValue
  • Unrecognized Attributes

<propertyValue>

Property values identify selectable values for a configuration property and cause the associated property to render as a drop-down-list displaying the available property values. You can define property values within <property></property> nodes. They support the following attributes:

  • resourceName/resourceFile/text
  • value
  • orderNumber
  • Unrecognized Attributes

<propertyRule>

Property rules implement a predefined behavior whenever their associated property's value is changed.  You can define property rules within <property></property> nodes. They support the following attributes:

  • type
  • processImmediately
  • Unrecognized Attributes

Retrieving Dynamic Configuration Values in Themes

The values of dynamic configuration properties can be retrieved within themes using the following Chameleon controls:

  • <CSControl:SiteThemeConfigurationData/>
  • <CSControl:SiteThemeConfigurationDataPropertyComparison/>
  • <CSControl:SiteThemeConfigurationDataPropertyValueComparison />
  • <CSControl:SiteThemeConfigurationDataImage/>
  • <CSControl:SiteThemeConfigurationDataStyle/>
  • <CSControl:SiteThemeConfigurationDataScript/>
  • <CSControl:SectionThemeConfigurationData/>
  • <CSControl:SectionThemeConfigurationDataPropertyComparison />
  • <CSControl:SectionThemeConfigurationDataPropertyValueComparison />
  • <CSControl:SectionThemeConfigurationDataImage/>
  • <CSControl:SectionThemeConfigurationDataStyle/>
  • <CSControl:SectionThemeConfigurationDataScript/>

You can also load them through the following API properties:

  • CommunityServer.Components.CSContext.Current.SiteThemeData
  • CommunityServer.Components.CSContext.Current.SectionThemeData

Existing ControlTypes

Here is a list of the control types that ship with Community Server.  You can use these to change the type of control that is displayed for your property.

  • CommunityServer.Controls.ContentFragmentsCustomControl
  • CommunityServer.Controls.HtmlEditorStringControl
  • CommunityServer.Controls.SiteFileUrlControl
  • CommunityServer.Controls.BlogFileUrlControl
  • Telligent.DynamicConfiguration.CssValueSelectionControl
  • Telligent.DynamicConfiguration.HtmlTextSelectionControl
  • Telligent.DynamicConfiguration.ImageSelectionControl
  • Telligent.DynamicConfiguration.MultilineStringControl