Skip to content
msCatalyst
msCatalyst
Faceted filter, search and catalog sync for miniShop2 and MiniShop3
  • MODX 2
  • MODX 3
  • miniShop2
  • miniShop3
  • PHP 7.2
  1. Extras
  2. msCatalyst
  3. Snippets
  4. msCatalyst

msCatalyst ​

The main snippet: filter panel, counters, sorting, search, pagination and product cards. Call it uncached.

modx
[[!msCatalyst?
  &parents=`5`
  &facets=`vendor, parent, option:color, ms:price|range`
]]

Properties ​

PropertyDefaultDescription
facetsvendor, parentList of facets, syntax below.
parentscurrent resourceComma-separated category IDs.
depth10How deep to look for products inside the categories.
includeCategories1Take additional product categories into account.
templatesOnly products with these template IDs.
showUnpublished0Show unpublished products.
showHidden1Show products with "Show in menu" unchecked.
sortsmenuindex, pagetitle, ms:price:asc, ms:price:descSort options. The first one is the default and is not added to the URL.
limits12, 24, 48Per-page options. The first one is the default.
search1Show the search field.
searchFieldspagetitle^3, longtitle, ms:article^5, introtext, description, contentSearch fields with weights: resource fields, ms:, tv:, option:. A match in the title ranks a product above a match in the description.
searchParamsearchURL parameter for search. Change it if search is already used on the site.
searchMin2Minimum query length.
searchModefilterfilter, page, live or live+page, see msCatalystSearch.
searchPageID or URL of the results page for page and live+page.
suggestLimit8Number of suggestions in live search.
richSearch1Word forms, transliteration and typos.
setFilter set name, see below.
seooffoff, native, seofilter or both, see SEO.
paginationbothpages (page numbers), more ("Show more" button), both or none.
first8How many values of a group are visible before the "Show all" button. 0 shows all.
hideSingle1Hide groups with fewer than two values.
hideUnavailable1Hide values that have no products under the current filters. Available values go to the top of the group. With 0, unavailable values stay greyed out at the bottom of the list.
langCatalog language, for example en. If empty, the language is detected automatically, see Multilingual.
langStrict1Localizator: hide products without a translation into the current language. With 0, such products are shown with their original fields.
view1The "Grid / List" switch.
noindexFiltered1noindex, follow on filtered pages.
elementmsProductsSnippet that outputs the cards.
tplmsCatalyst.cardCard chunk. msCatalyst passes it to element. With your own chunk, set &rowsClass to match the theme grid.
tplOutermsCatalyst.outerChunk for the whole block.
tplGroupmsCatalyst.groupChunk for a group of checkboxes.
tplOptionmsCatalyst.optionChunk for a single checkbox.
tplRangemsCatalyst.rangeChunk for a range.
tplEmptymsCatalyst.empty"Nothing found" chunk.
rowsClassmsc-gridClass of the card container. With your own card chunk you can set the theme grid class, for example row.
breakpoint992Width in pixels below which the panel becomes a slide-out.
toPlaceholderWrite the output to a placeholder.
css, js, cacheTimefrom settingsOverride system settings for one call.

Properties that msCatalyst does not know are passed to the element snippet. This is how &includeTVs, &includeThumbs and other msProducts properties get through. msCatalyst sets resources, parents, sortby, limit and offset itself, and drops where and tvFilters: it does the filtering.

Facet syntax ​

Facets are comma-separated. A facet consists of a source, a name and modifiers separated by |:

source:name|modifier|modifier=value

Sources ​

SourceExampleWhere the values come from
vendorvendorProduct vendor. Label: vendor name.
parentparentParent category of the product. Label: pagetitle.
msms:color, ms:priceA field of the ms2_products table (ms3_products in MiniShop3). JSON arrays color, size, tags are split into separate values.
tvtv:colorA TV. Multiple values are split by ||. Labels and order come from the TV "Input Option Values" in the Label==value format.
optionoption:sizeA product option (ms2_product_options or ms3_product_options). Group title: the option caption.
resourceresource:templateA resource field: template, publishedon, createdby and others.
msop, variantmsop:price|rangeModification fields of msOptionsPrice2 and ms3Variants, see MODX 3 and modifications.

Modifiers ​

ModifierExampleWhat it does
rangems:price|rangeA "from–to" range instead of checkboxes. Does not work for vendor and parent.
step|step=100Slider step.
title|title=ЦветGroup title.
alias|alias=cKey in the URL instead of the name: ?c=red. Required if two facets end up with the same name.
sort|sort=countValue order: label (by label, default), count (by count), value (by value, numbers in natural order), index (order from the TV or the menuindex of categories).
lex|lex=color_The label for the value red comes from the lexicon entry color_red, if it exists.
first|first=5A custom "Show all" threshold for the group.
open, closed|closedThe group is expanded or collapsed by default. Without the modifier, the first group, ranges and groups with selected values are expanded.
and|andA product must have all selected values. By default any one is enough.
labelparent|label=menutitleFor parent: the label comes from menutitle or longtitle.
delimitertv:tags|delimiter=,TV value delimiter instead of ||.

JSON ​

Instead of a string you can pass a JSON array. This helps when a title needs a comma:

modx
&facets=`[
  {"source": "vendor", "sort": "count"},
  {"source": "ms", "name": "price", "range": true, "step": 100},
  {"source": "tv", "name": "color", "title": "Цвет, оттенок", "lex": "color_"}
]`

Reserved keys ​

The keys mscatalyst, sort, limit, page, the search parameter and MODX URL parameters (q, id) are reserved. If a facet name matches one of them, set |alias=. msCatalyst writes configuration errors to the MODX error log with the [msCatalyst] prefix, and the snippet outputs nothing in that case.

URL format ​

/catalog/?vendor=1,3&size=10%2C5%20mm&price=1000..2000&search=шланг&sort=ms-price-desc&limit=24&page=2
  • Multiple values of one facet are comma-separated. A comma inside a value is encoded as %2C.
  • The form without JavaScript sends vendor[]=1&vendor[]=3. msCatalyst understands both forms.
  • A range is written as price=1000..2000, price=1000.. or price=..2000. The form without JavaScript sends price_min and price_max, and that works too.
  • Sort values: pagetitle-asc, ms-price-desc, tv-rating-desc.
  • AJAX requests go to the same URL with the mscatalyst=<hash> parameter. This parameter does not appear in the address bar.

Filter sets ​

A set stores facets, sorts and search fields for several catalogs at once. &set=`catalog` reads the system setting mscatalyst_set_catalog or the file core/components/mscatalyst/sets/catalog.json. An example is in sets/catalog.example.json. Sets are easiest to manage on the "Filter sets" tab of the component page.