Autogenerated select examples

These snippet calls can be used to generate select options in an autogenerated select CB.

Note: you may experience problems with processing field_name (and sometimes other placeholders) inside the tpl chunks. That's why it's good practice to forward these placeholders in the snippet call, which you'll notice in the examples below.

Using pdoResources

[[!pdoResources?
    &parents=`[[++romanesco.pattern_container_id]]`
    &depth=`0`
    &limit=`5`
    &tpl=`fbSelectOptionRowResource`
    &sortby=`menuindex`
    &sortdir=`ASC`
    &field_name=`field_name`
]]

Using migxLoopCollection

[[migxLoopCollection?
    &packageName=`FoodBrain`
    &classname=`foodSpecies`
    &tpl=`fbSelectDropdownRowInputOption`
    &addfields=`field_name:[[!fbStripAsAlias:fbPrefixOutput? &input=`[[+field_name]]`]]`
    &outputSeparator=``
    &sortConfig=`[{"sortby":"name","sortdir":"DESC"}]`
]]

For getting Romanesco input options

[[migxLoopCollection?
    &packageName=`romanescobackyard`
    &classname=`rmOption`
    &tpl=`fbSelectOptionRowInputOption`
    &addfields=`field_name:[[+field_name]],field_type:[[+field_type]],checkbox_type:[[+checkbox_type]]`
    &outputSeparator=``
    &where=`[{"key":"forest_category"}]`
    &sortConfig=`[{"sortby":"position","sortdir":"ASC"}]`
]]

Country options

Note: for some reason, you need to place this snippet call outside of the Select Options (Autogenerated) code field. Add the placeholder there instead.

[[FormItCountryOptions?
    &prioritized=`PH,NL,DE,BE,CH`
    &useIsoCode=`1`
    &toPlaceholder=`country_options`
]]
[[!$fbSelectCountry?
    &field_name=`[[+field_name:fbStripAsAlias:fbStripNonAlpha]]`
]]