Skip to content
  1. Extras
  2. ms3Favorites
  3. Snippets
  4. ms3FavoritesCounter

Snippet ms3FavoritesCounter ​

Outputs the number of items in favorites. Used in header, menu, or Favorites icon.

Parameters ​

ParameterDescriptionDefault
idID of page where the list is shown (optional)—
listList (default); empty or all — total across all listsdefault
resource_typeResource type: products, resourcesproducts
tplChunktplMs3fCounter

Chunk placeholders ​

PlaceholderDescription
[[+ms3f_count]]Item count
[[+ms3f_page_id]]Page ID (if passed)

Examples ​

modx
[[!ms3FavoritesCounter]]
fenom
{'!ms3FavoritesCounter' | snippet}

Total across all lists:

modx
[[!ms3FavoritesCounter? &list=`all`]]
fenom
{'!ms3FavoritesCounter' | snippet : ['list' => 'all']}

Alternative — client-side counter:

html
<span data-favorites-count style="display: none;">0</span>

After load the script sets the text to 1–99 or 99+ for larger counts; when the total is zero the element stays hidden.