Configuration syntax in config.template.php

All SCHLIX CMS plugin configuration is controlled by config.template.php file. The file is just a regular HTML file that contains schlix-config tags.

There are 3 (three) attributes that are parsed:

  • label (the text to be displayed, often used in conjunction with ___('text') for translation),
  • config-key (configuration variable key name), and
  • config-default-value (Default value if unconfigured). Other variables otherwise will be translated into a regular HTML tag attribute. All configuration keys must start with any of the following prefix: int_, bool_, str_, array_

A. Application Alias and Description

These two are special configuration keys for application. For example:

<schlix-config:app_alias class='form-control' />
<schlix-config:app_description class='form-control' />

Note that the 'form-control' CSS class has nothing to do with the parsing of the input.

B. Group Permissions

This configuration tag is a checkbox group containing the user group names. It is usually used to give the administrator option of backend user access.

<schlix-config:permission-usergroups config-key='array_groups_allowed_for_backend_access' label='<?=  ___('Enable backend access for the following user groups') ?>' />

C. Text Box

<schlix-config:textbox config-key='str_meta_keywords' label='<?= ___('Default Meta Keywords') ?>' class='form-control' />
<schlix-config:textbox config-key='str_meta_description' label='<?=  ___('Default Meta Description') ?>' class='form-control' />

D. Integer Box

<schlix-config:integerbox config-key='int_mainpage_items_per_page' config-default-value="10" label='<?= ___('Default maximum mumber of items to be displayed per page') ?>' class='form-control' />

E. Text Area

For this configuration key, if you wish to use WYSIWYG control, simply add the wysiwyg CSS class. Otherwise, you can just use the default Bootstrap form-control CSS class.

<schlix-config:textarea config-key='str_example_2' label="<?= ___('Textarea Example') ?>" class='wysiwyg' />             
<schlix-config:textarea config-key='str_example_3' label="<?= ___('Non-WYSIWYG textarea example') ?>" class='form-control'  />             

F. Checkbox

Checkbox is usually associated with config key that starts with bool_

<schlix-config:checkbox config-key='bool_checkbox_example' label='<?= ___('Checkbox Example') ?>' />

G. Checkbox Group

<schlix-config:checkboxgroup config-key="array_option_checkbox" label="<?= ('Checkbox group example') ?>">
    <schlix-config:option value="1"><?= SAFE_HTML('Option 1') ?></schlix-config:option>
    <schlix-config:option value="2"><?= SAFE_HTML('Option 2') ?></schlix-config:option>
    <schlix-config:option value="3"><?= SAFE_HTML('Option 3') ?></schlix-config:option>
</schlix-config:checkboxgroup>    

Notice how the config-key starts with array_. This means that it can store multiple selections.

H. Dropdown list

<schlix-config:dropdownlist class="form-control" config-key="str_option_select" label="<?= ___('Dropdown list example') ?>" >
    <schlix-config:option value="0"><?= ___('Please select') ?></schlix-config:option>
    <schlix-config:option value="<?= SAFE_HTML('opt1') ?>"><?= SAFE_HTML('Option 1') ?></schlix-config:option>
    <schlix-config:option value="<?= SAFE_HTML('opt2') ?>"><?= SAFE_HTML('Option 2') ?></schlix-config:option>
    <schlix-config:option value="<?= SAFE_HTML('opt3') ?>"><?= SAFE_HTML('Option 3') ?></schlix-config:option>
</schlix-config:dropdownlist> 

i. Radio Group

Radio group works almost in the same way as the dropdown list.

<schlix-config:radiogroup config-key="int_option_radio" label="<?= ('Radio group example') ?>">
    <schlix-config:option value="1"><?= SAFE_HTML('Option 1') ?></schlix-config:option>
    <schlix-config:option value="2"><?= SAFE_HTML('Option 2') ?></schlix-config:option>
    <schlix-config:option value="3"><?= SAFE_HTML('Option 3') ?></schlix-config:option>
</schlix-config:radiogroup>