Involver Developer Network : editable_setting
This page last changed on Aug 17, 2012 by yuriy.kalynovskiy@involver.com.
OverviewUsed to allow an SML developer to assign string and/or boolean settings in the SML template. Admins can edit the values of the settings from a simple auto-generated form. To configure an editable_setting item, click the "Settings" tab in your SML editor window. Use Case ScenariosThe main purposes of this tag are to
For example, an SML developer can specify a 'boolean' editable setting that allows an admin to toggle the showing/hiding of a particular section of the page. An SML developer could also create a setting for a particular ID that they want to template in the application and make configurable by an admin. Caching ConsiderationsThis tag has no caching considerations. Attributes
ExamplesCreating a setting for a stringPasting this code into the template will render out the default value "my default string". {% editable_setting my_string type:"string" default:"my default string" %} {{ my_string }} The default value can be changed by an admin by going to the "Settings" section of the SML editor: Go ahead and change the field to "my custom string" and click "Save Settings". You should see "my custom string" display on the tab now. Creating a setting for a booleanPasting this code into the template will render out "I am true". {% editable_setting my_boolean type:"boolean" default:true %} {% if my_boolean == true %} I am true {% endif %} The default value can be changed by an admin by going to the "Settings" section of the SML editor: Go ahead and select the "False" button and click "Save Settings". You should no longer see "I am true" on the tab now. Creating a setting for a listPasting this code into the template will render out the default value "option 1". {% editable_setting nameofvar label:'label' options:'option 1,option 2, option 3' default:'option 1' type:'string' %}
{{ nameofvar }}
The default value can be changed by an admin by going to the "Settings" section of the SML editor: FAQThis tag currently has no FAQ questions. Related Topics![]() ![]() ![]() ![]() |
![]() |
Document generated by Confluence on Feb 12, 2013 09:09 |