smithery/bnomei

kirby-collections-and-navigation

Builds Kirby listings, pagination, search, filtering/sorting/grouping, and navigation menus. Use when implementing collection logic in templates/controllers/snippets.

Installation

$ npx skills add smithery/bnomei --skill kirby-collections-and-navigation

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/bnomei · top by installs.

npx skills add smithery/bnomei

Browse all from smithery/bnomei

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,555 B
  • docs SUMMARY.md 206 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Kirby Collections and Navigation

KB entry points

  • kirby://kb/scenarios/07-pagination
  • kirby://kb/scenarios/08-search-page
  • kirby://kb/scenarios/09-filtering-with-tags
  • kirby://kb/scenarios/11-navigation-menus
  • kirby://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 items collection and pagination.
  • Render items via a snippet to avoid repeated template logic.
  • Provide empty-state and active-navigation UI.
  • Default sort: use date desc when the field exists; otherwise fall back to title 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

  1. Clarify collection scope (site vs section), filters, sort order, and UI (pagination, tag filters, menu style).
  2. Call kirby:kirby_init and read kirby://roots.
  3. Inspect existing templates/controllers/snippets to reuse patterns:

- kirby:kirbytemplatesindex - kirby:kirbycontrollersindex - kirby:kirbysnippetsindex

  1. Prefer controllers for collection logic; keep templates thin.
  2. Search the KB with kirby:kirby_search for task playbooks (examples: "pagination", "search page", "filtering with tags", "navigation menus", "collections filtering").
  3. Implement or adjust collection queries; add snippets for repeated UI.
  4. Verify rendering and pagination URLs with kirby:kirbyrenderpage(noCache=true).