Skip to content
Back to skills

Kirby Collections And Navigation

ASecurity

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

  • 61 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 7, 2026
toolsphp

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add bnomei/kirby-mcp --skill kirby-collections-and-navigation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Kirby Collections And Navigation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Kirby Collections And Navigation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bnomei-kirby-collections-and-navigation/badge)](https://www.skillsdirectory.com/skills/bnomei-kirby-collections-and-navigation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

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-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:

```php
return function ($page) {
  $items = $page->children()->listed()->sortBy('date', 'desc')->paginate(10);
  return [
    'items' => $items,
    'pagination' => $items->pagination(),
  ];
};
```

Snippet:

```php
<?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:kirby_templates_index`
   - `kirby:kirby_controllers_index`
   - `kirby:kirby_snippets_index`
4. Prefer controllers for collection logic; keep templates thin.
5. Search the KB with `kirby:kirby_search` for task playbooks (examples: "pagination", "search page", "filtering with tags", "navigation menus", "collections filtering").
6. Implement or adjust collection queries; add snippets for repeated UI.
7. Verify rendering and pagination URLs with `kirby:kirby_render_page(noCache=true)`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.