← Back to list

kirby-collections-and-navigation
by bnomei
CLI-first MCP server for composer-based Kirby CMS projects — inspect blueprints/templates/plugins, interact with a real Kirby runtime, and use a bundled Kirby knowledge base.
⭐ 20🍴 0📅 Jan 20, 2026
SKILL.md
name: kirby-collections-and-navigation description: Builds Kirby listings, pagination, search, filtering/sorting/grouping, and navigation menus. Use when implementing collection logic in templates/controllers/snippets.
Kirby Collections and Navigation
KB entry points
kirby://kb/scenarios/07-paginationkirby://kb/scenarios/08-search-pagekirby://kb/scenarios/09-filtering-with-tagskirby://kb/scenarios/11-navigation-menuskirby://kb/scenarios/23-collections-filtering
Required inputs
- Collection source (page/section/template or ids).
- Filters, sort order, and pagination size.
- Target templates/snippets and UI expectations.
Default pattern
- Keep collection building in the controller; return a single
itemscollection andpagination. - Render items via a snippet to avoid repeated template logic.
- Provide empty-state and active-navigation UI.
- Default sort: use
date descwhen the field exists; otherwise fall back totitle asc.
Example
Controller:
return function ($page) {
$items = $page->children()->listed()->sortBy('date', 'desc')->paginate(10);
return [
'items' => $items,
'pagination' => $items->pagination(),
];
};
Snippet:
<?php if ($items->isEmpty()): ?>
<p>No items yet.</p>
<?php else: ?>
<?php foreach ($items as $item): ?>
<!-- render item -->
<?php endforeach ?>
<?php snippet('pagination', ['pagination' => $pagination]) ?>
<?php endif ?>
Output checklist
- Ensure pagination URLs preserve filters and tags.
- Render empty states without PHP notices.
- Confirm active navigation matches the current page.
Common pitfalls
- Dropping query params or tag filters on pagination links.
- Implementing heavy collection logic in templates instead of controllers.
Workflow
- Clarify collection scope (site vs section), filters, sort order, and UI (pagination, tag filters, menu style).
- Call
kirby:kirby_initand readkirby://roots. - Inspect existing templates/controllers/snippets to reuse patterns:
kirby:kirby_templates_indexkirby:kirby_controllers_indexkirby:kirby_snippets_index
- Prefer controllers for collection logic; keep templates thin.
- Search the KB with
kirby:kirby_searchfor task playbooks (examples: "pagination", "search page", "filtering with tags", "navigation menus", "collections filtering"). - Implement or adjust collection queries; add snippets for repeated UI.
- Verify rendering and pagination URLs with
kirby:kirby_render_page(noCache=true).
Score
Total Score
75/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon


