
Reactions
Universal reactions for MODX 3 — likes, GitHub-style sets, tops and trending on any object


Text counters without buttons, for cards, lists, and meta rows.
| Parameter | Default | Description |
|---|---|---|
class | modResource | Object class (class_key in the API) |
object | current resource ID | Object ID |
context | current context key | MODX context |
format | {TOTAL} | String with placeholders |
type | (empty) | Narrow filter by type name (like, love…) |
toPlaceholder | (empty) | Placeholder name instead of direct output |
| Placeholder | Description |
|---|---|
{TOTAL} | Sum of all reactions |
{LIKES} | Sum of like + up |
{DISLIKES} | Sum of dislike + down |
{RATING} | LIKES − DISLIKES |
{PCT_UP} | Like share of the total, 0–100 |
{PCT_DOWN} | Dislike share of the total, 0–100 |
{like}, {love}, {funny}… | Count for that type. No data → 0, not a raw {love} |
{TOTAL} only [[!ReactionsCount]]{'!ReactionsCount' | snippet}Sample output: 15.
[[!ReactionsCount?
&format=`Всего {TOTAL}: 👍 {LIKES} / 👎 {DISLIKES}`
]]{'!ReactionsCount' | snippet : [
'format' => 'Всего {TOTAL}: 👍 {LIKES} / 👎 {DISLIKES}',
]}[[!ReactionsCount?
&format=`Рейтинг {RATING} · ↑{PCT_UP}% · ↓{PCT_DOWN}%`
]]{'!ReactionsCount' | snippet : [
'format' => 'Рейтинг {RATING} · ↑{PCT_UP}% · ↓{PCT_DOWN}%',
]}&type= [[!ReactionsCount?
&type=`like`
&format=`Лайков: {like}`
]]{'!ReactionsCount' | snippet : [
'type' => 'like',
'format' => 'Лайков: {like}',
]}format Names without a separate &type=:
[[!ReactionsCount?
&format=`❤️ {love} · 🔥 {fire} · ⭐ {star} · 🚀 {rocket}`
]]{'!ReactionsCount' | snippet : [
'format' => '❤️ {love} · 🔥 {fire} · ⭐ {star} · 🚀 {rocket}',
]}Zero and missing types print as 0.
[[!ReactionsCount? &format=`{LIKES}`]]{'!ReactionsCount' | snippet : ['format' => '{LIKES}']}[[!ReactionsCount?
&class=`msProduct`
&object=`[[*id]]`
&format=`Товар: 👍 {LIKES} · всего {TOTAL}`
]]{'!ReactionsCount' | snippet : [
'class' => 'msProduct',
'object' => $_modx->resource.id,
'format' => 'Товар: 👍 {LIKES} · всего {TOTAL}',
]}[[!ReactionsCount?
&object=`[[+id]]`
&format=`Всего {TOTAL}: 👍 {LIKES} / 👎 {DISLIKES}`
&toPlaceholder=`rx.count`
]]
[[+rx.count]]{'!ReactionsCount' | snippet : [
'object' => $id,
'format' => 'Всего {TOTAL}: 👍 {LIKES} / 👎 {DISLIKES}',
'toPlaceholder' => 'rx.count',
]}
{$_modx->getPlaceholder('rx.count')}Not verified on MODX 3. Call:
[[!ReactionsCount?
&class=`TicketComment`
&object=`[[+id]]`
&format=`{LIKES}`
]]{'!ReactionsCount' | snippet : [
'class' => 'TicketComment',
'object' => $id,
'format' => '{LIKES}',
]}