0
votes

I would like to apply the grouped text in listbox, looks like this
1
to
enter image description here this is listbox in the resources page.

I tried to add the ‘optgroup’ tag into 'manager\templates\default\element\tv\renders\input\listbox-multiple.tpl' but still not working, the 'optgroup’ tag will be ignored.

I unterstand that I should ‘Adding a Custom TV Input Type’ but the document didn’t include the details about grouping input values.

1
There is no info about grouping cause this is extra work for modx devs. Also there is no built in realisation of grouping at Extjs ComboBox and Extjs at all. But there is special plugin without demo. Hope it helps. - rogaldh
My hack: use "----" before any item in subgroups. - Vasis

1 Answers

0
votes

That is easy ;) your listbox should contain a @CHUNK yourchunk In that chunk you can perform nearly everything, that genereates a list, like:

    <select name="something" id="something" >
    <option value="" selected disabled>choose</option>
    <optgroup label="Headline 01">
    [[pdoResources? &parents=`0` &where=`{"template:=":40` &sortby=`{"value":"ASC"}` &limit=`40` &tpl=`pdoResourcesFormoption-something` &includeTVs=`some-tv`]]
    </optgroup>

    <optgroup label="Headline 02">
    [[pdoResources? &parents=`0` &where=`{"template:=":41` &sortby=`{"value":"ASC"}` &limit=`40` &tpl=`pdoResourcesFormoption-something` &includeTVs=`some-tv`]]
    </optgroup>

    <optgroup label="Headline 03">
    [[pdoResources? &parents=`0` &where=`{"pagetitle:=":"something"` &sortby=`{"value":"ASC"}` &limit=`40` &tpl=`pdoResourcesFormoption-something` &includeTVs=`some-tv`]]
    </optgroup>