This site uses cookies in order for our service to work better. Learn more I understand

Helper configuration

Every widget has a special configuration file which allows for displaying the widgets options in the so called widget inserter, which is displayed while inserting a widget.

Configuration file is in ./data/widgets/widgetname/doc/helper.ini

Example code looks like this:
 
type.name = "type"
type.rule = ""
type.inputType = "select"
type.dateType = "commaArray"
type.date = "lastest,views,position,author"

bucket.name = "bucket"
bucket.rule = ""
bucket.inputType = "select"
bucket.dateType = "php"
bucket.date = "$pagesDB=new pagesDB(); $pagesArray = $pagesDB->getGroupsArrayForWidgetInserter(); $inputData=array('option'=>$pagesArray);"

fit.name = "fit"
fit.rule = ""
fit.inputType = "select"
fit.dateType = "php"
fit.date = "$inputData=array('option'=>image::$imageProcessorArray);"

filter.name = "filter"
filter.rule = ""
filter.inputType = "select"
filter.dateType = "php"
filter.date = "$inputData=array('option'=>image::$imageFiltersArray);"

Where the variables are:
  • NameOfVariable.name - name of the link {{W name="nazwa widgetu" NameOfVariable="variable given by user"}}
  • NameOfVariable.rule - type of validator, if we don't want user to give word instead of number, main use here has validator "numeric"
  • NameOfVariable.inputType- type of input element, we can choose from: select, input-text, textarea
  • NameOfVariable.dataType = type of data returned by object when we give user the choice (select elements), we can chose from:commaArray - we give variables after a comma in a parameter NameOfVariable.data which then are displayed as a choice list, php - variables come from the PHP code result
  • NameOfVariable.date = here we're assigning variables, so its either our PHP code calling out helper or variables divided by commas, if we want to enter normal intupt We don't have to define this spot like the above one.
 

Help Center

Do you have a technical problem?