New Module Custom Global Settings
Posted: Sun Feb 19, 2012 12:56 pm
The Custom Global Settings module extends the Global Settings with some customized parameters. You can define an unlimited number of fields which can be used as smarty-variable in templates or pages.
The initial module (with limited options) was created by me, but *Gallery* Jos will continue the development of this module! Jos already added some new features, making it a very flexible and versatile module.
In the Custom Global Settings module Fielddefinitions tab you can define several field definitions. In the templates or pages of your website you will have all smarty variables available!
The exact way to call each variable is shown in the fielddefinitions table. You can also check which variables and values are available by placing {CustomGS showvars=1} in the content field of a page.
Available fielddefinitions
- Textfield
- Pulldown
- Checkbox
- Radiobutton group
- Datepicker
- DateTimepicker
- Timepicker
- Text Area
- WYSIWYG Area
- Button
Some examples
Start with adding the moduletag in the top of your template
Define a checkbox 'Christmas now' which will activate a special theme on the frontend when checked.
Define a checkbox 'MyCheckbox' which will do some magic stuff when unchecked
Define a textfield or pulldown field 'Trainer' which will contain the current trainers name.
Define two timepicker fields 'starttime' and 'endtime'. Replace the {content} tag in your page template with this code and the normal page content is only visible when the current time is between the starttime and endtime.
Upgrading? The way smarty variables should be called has changed. If you upgrade from 1.0 you have to rename the smarty variables in your templates or pages
Have fun!!
Jos & Rolf
The initial module (with limited options) was created by me, but *Gallery* Jos will continue the development of this module! Jos already added some new features, making it a very flexible and versatile module.
In the Custom Global Settings module Fielddefinitions tab you can define several field definitions. In the templates or pages of your website you will have all smarty variables available!
The exact way to call each variable is shown in the fielddefinitions table. You can also check which variables and values are available by placing {CustomGS showvars=1} in the content field of a page.
Available fielddefinitions
- Textfield
- Pulldown
- Checkbox
- Radiobutton group
- Datepicker
- DateTimepicker
- Timepicker
- Text Area
- WYSIWYG Area
- Button
Some examples
Start with adding the moduletag in the top of your template
Code: Select all
{CustomGS}
Code: Select all
{if $CustomGS.Christmas_now == '1'}
{* Show Christmas frontend theme *}
{else}
{* Show default frontend theme *}
{/if}
Code: Select all
{if $CustomGS.MyCheckbox != '1'}
{* Do some magic stuff *}
{/if}
Code: Select all
<p>This weeks trainers name is: {$CustomGS.Trainer}</p>
Code: Select all
{if $smarty.now|date_format:'%H:%M' >= $CustomGS.starttime && $smarty.now|date_format:'%H:%M' <= $CustomGS.endtime}
{content}
{else}
{content block="SiteClosedContent"}
{/if}
Have fun!!
Jos & Rolf