ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Add setting to custom mojoPortal module

Categories: mojoPortal

Small example showing how to add a Custom Css Class to your module.

  1. Add code using the setting eg. Page_Load
  2. Update config xml eg. Setup/applications/FeatureDefinitions/MyModule.config
  3. Add resource in App_GlobalResources eg. CustomCssClassSetting as 'Custom Css Class'
  4. Run the system setup
if (Settings.Contains("CustomCssClassSetting"))
{
    var instanceCssClass = Settings["CustomCssClassSetting"].ToString();
    if (instanceCssClass.Length > 0) { pnlOuterWrap.SetOrAppendCss(instanceCssClass); }
}
<featureSetting
   resourceFile="MyModuleResources"
   grouNameKey=""
   resourceKey="CustomCssClassSetting"
   defaultValue=""
   controlType="TextBox"
   controlSrc=""
   helpKey="custom-module-css-class-help"
   sortOrder="3000"
   regexValidationExpression="^([\s]?[a-zA-Z]+[_\-a-zA-Z0-9]+)*\z+"
/>