Blog Sections Open

Filtering Resource Listings by a TV Value with DocLister or Ditto

Filtering by a TV looks simple until the listing engine and the stored value format stop agreeing with each other.

Two common ways of filtering a listing by a TV value: one with DocLister and one with Ditto. That comparison is still useful because the real issue is not the snippet name. It is how the TV value is stored and matched.

Example approaches

[[DocLister? &tpl=`fvyd` &parents=`30` &display=`20` &filters=`filter:tv:grafik:like:1`]]
[[Ditto? &startID=`30` &tpl=`fvyd` &filter=`grafik,1,2`]]

What to verify first

  • how the TV actually stores the value: raw number, comma list, checkbox list, or rendered label
  • whether the filter must match the raw stored value or a display value
  • whether the listing needs exact matching or loose matching such as like

If the TV storage format is unclear, the filter will look random even when the syntax is valid.

Rule of thumb

DocLister tends to be the better fit when filtering gets more structured and the project needs a clearer data flow. Ditto can still work, but TV filtering becomes much easier to reason about when the dataset and filter logic are explicit.

Newer post

Displaying Shopkeeper Product TVs Through catalogFill Data Sources

How to connect Shopkeeper-style product output with catalogFill data sources when product attributes live in a separate content structure.

Older post

Fixing Pagination with getResourcesTag and tagLister

How to troubleshoot pagination when combining tagLister, getResourcesTag, and pageNav so that page 2 and later pages keep working correctly.