Blog Sections Open
Filtering Ditto Results by Checkbox TV Values
A guide to turning checkbox TV values into usable Ditto filters when the raw stored format is not friendly enough for direct frontend forms.
Checkbox TVs are convenient for editors but often awkward for frontend filtering because the stored value format is not designed for human-friendly form controls. the underlying example showed exactly that problem: checkbox values worked inside the TV, but the generated select options were not usable as-is for Ditto filtering.
The real issue
Checkbox TVs often store multiple values in a delimiter-heavy internal format. If you pass that format directly into form options, the UI becomes confusing and the request values become harder to map back into meaningful filters.
Better approach
- Separate the editor-facing labels from the raw stored value format.
- Normalize the selected value before passing it into Ditto.
- Keep the filter UI human-readable even if the TV storage format is not.
Once you decouple the displayed option labels from the stored checkbox payload, Ditto filtering becomes much easier to reason about. That is the reusable lesson here: do not let the TV storage format define the frontend UX.
Sorting Ditto Listings by Price from a TV Value
How to build request-driven price sorting for Ditto listings when product price lives in a TV field.
Using DLRequest to Drive DocLister Sorting and Display from GET and POST
How to build request-driven sorting, direction, and display controls for DocLister with DLRequest.