Loading...
Loading...
Use when creating or managing reusable queries that multiple loop elements can share. Covers the `bricks_global_queries` option, categories, and how a query-list control on an element references a global query by ID.
npx skill4agent add codeerhq/bricks-skills bricks-global-queries_BS_UPDATE_CHECK=""
for _CAND in "$HOME/.bricks/skills/bricks-skills/scripts/bricks-skills-update-check" "$PWD/scripts/bricks-skills-update-check" "$HOME/.claude/skills/bricks-skills/scripts/bricks-skills-update-check" "$HOME/.codex/skills/bricks-skills/scripts/bricks-skills-update-check"; do
[ -f "$_CAND" ] && _BS_UPDATE_CHECK="$_CAND" && break
done
[ -n "$_BS_UPDATE_CHECK" ] && sh "$_BS_UPDATE_CHECK" || trueBRICKS_SKILLS_UPDATE_AVAILABLE <old> <new> <tag>BRICKS_SKILLS_JUST_UPDATED <old> <new>bricks_global_queriesidnamecategorysettingsbricks_global_queries_categoriesidnamebricks/list-global-queriesbricks/get-global-query{ queryId }bricks/create-global-query{ label, category?, query }{ query }labelquerynamesettingscategorybricks/update-global-query{ queryId, label?, category?, query? }querybricks/delete-global-query{ queryId }bricks/create-global-query-category{ name }{ category }bricks/delete-global-query-category{ categoryId }{
objectType: "post", // "post" | "term" | "user"
postType: ["post"],
posts_per_page: 6,
orderby: "date",
order: "DESC",
meta_query: [ ... ],
tax_query: [ ... ]
}objectTypequeryposttermuserarrayapiposttermuserbricks/posts/query_varsbricks/terms/query_varsbricks/users/query_varsobjectTypeincludes/abilities/queries.php:123-142settings.query.idquery:
id: "abc123" // presence of this makes Bricks load the global query settings
# inline args are ignored when id points to a valid global querybricks/update-elementbricks/update-global-query
queryId: abc123
category: "cat_abc"bricks/create-global-query-categorycreate-global-queryupdate-global-querycategoryIf aability is not available as a direct tool: first check whether it is outside the fast path and call it throughbricks/*withmcp-adapter-execute-ability. If the dispatcher also rejects it, callability_name: "bricks/<name>"to check whether a site admin disabled it under Bricks > AI.bricks-list-ability-status
bricks/create-global-query-category { name: "Shop" }
-> { category: { id: "cat_abc", name: "Shop" } }
bricks/create-global-query
label: "Featured Products"
category: "cat_abc"
query:
objectType: "post"
postType: ["product"]
posts_per_page: 8
meta_query:
- { key: "_featured", value: "yes" }
-> { query: { id: "fp_8h2", name: "Featured Products", category: "cat_abc", settings: {...} } }
# Now bind it to an existing Products Loop element:
bricks/update-element
postId: 42
elementId: "loop-xyz"
settings:
query:
id: "fp_8h2"settings.query.idget_the_ID()bricks/posts/query_vars{post_id}bricks/posts/query_vars