• MODX.com

    1,035 downloads

SetInputOptions

SetInputOptions is an extra by qaraqter, first released on 2015-05-18.

Package Description

++ SetInputOptions 1.0.3-pl++ Released on 15-04-2015+++++++++++++++++++++++++

- Update changelog- Update readme- Minor cleanup

Usage/Installation Instructions

How to use the SetInputOptions extra for MODX

  • Install SetInputOptions through the package manager
  • Go to Extra's > Set Input Options and create a group with some options
  • Create a TV with an @SELECT binding to your custom input options as Input Option Value (see example below)
  • Fetch the input option values in your content with the getInputOptions or Rowboat snippets

Connect your TV to your custom input options

An example of an @SELECT binding for checkboxes and radios:

@SELECT `name` AS `name`,`id` FROM `[[+PREFIX]]setinputoptions_inputoptions` WHERE `group` = 2 AND `softDelete` = 0 ORDER BY `position`

An example @SELECT binding for listboxes and multiselects. Note the first part up till `UNION ALL`, this adds an empty first item to your TV.

@SELECT '' AS name, '' AS id UNION ALL ( SELECT `name` AS `name`,`id` FROM `[[+PREFIX]]setinputoptions_inputoptions` WHERE `group` = 1 AND `softDelete` = 0 ORDER BY `position` )

Display input option values using the getInputOptions snippet

[[getInputOptions? &tv=`[[*your_template_variable]]`]]

Available properties:

  • tpl
  • delimiter
  • outputDelimiter

Available placeholders in the row tpl:

  • name
  • alias

Display input option values using the Rowboat snippet

You can also use Rowboat to list all the options in a group. Useful for example, for creating filter buttons. Don't forget to download and install Rowboat separately through package manager!

[[Rowboat?    &table=`modx_setinputoptions_inputoptions`    &tpl=`filterButtonsRow`    &limit=`10`    &sortBy=`position`    &where=`{"group":"1"}`]]

Details

Developer(s)
qaraqter
Released
2015-05-19
First seen
2015-05-18
License
GPLv2
Supported databases
Minimum MODX Requirement
2.2

SetInputOptions Releases

Vendor Signature Released on
MODX.com 1.0.3-pl 2015-05-19 (9 years ago)

We've also seen 2 unverified versions of SetInputOptions in use, but don't list those as we've been unable of confirming they are official releases from an official source.