Download the PHP package shallowred/kirby-collection-manager without Composer

On this page you can find all versions of the php package shallowred/kirby-collection-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-collection-manager

Kirby Collection Manager

AJAX-powered collection listings for Kirby CMS: search, filters, sorting and pagination, rendered server-side and enhanced with htmx. Works without JavaScript, supports several independent collections on the same page, and ships with sensible default snippets you can override.

Installation

Requires PHP 8.1+ and Kirby 4 or 5.

Quick start

The plugin follows Kirby's controller/template split. In a controller (page controller, snippet controller or block controller), hand your collection to CollectionController::handle():

Then render the wrapper snippet in the template:

That's it: search form, filter pills, paginated items — with AJAX swaps when JavaScript is available, plain links and form submits when it is not.

There is also a shorthand page method:

Configuration

All keys are optional; defaults shown below.

Visitor-facing sorting

Offer sort options with the field:direction syntax (direction defaults to sorting.direction). Requested values are validated against this whitelist.

Multi-select filters

Set 'multiple' => true on a taxonomy to let visitors combine values. Options toggle in and out of a comma-separated param (?category=Design,Engineering) and items match when any of their values match.

Several collections on one page

Give each instance its own pagination param — everything else (fragment targeting, URL generation) is scoped automatically:

Custom item template

Point snippets.item to your own snippet; it receives $item (the page), $orderIndex and $config:

Any other snippet (search, filters, pagination, sorting, indicator, wrapper) can be overridden the same way, or globally by creating a snippet with the same name in site/snippets/.

Styling

Three levels of customization, from lightest to fullest. They compose freely.

1. Default stylesheet + CSS variables

Enable the bundled stylesheet (injected once, however many instances):

Or include it manually:

The whole file lives in the collection-manager cascade layer, so any rule in your own stylesheet overrides it — no specificity fights. Theme it by overriding the --cm-* variables:

Dark mode follows prefers-color-scheme automatically, or force it with a .cm-dark class (also honors [data-theme="dark"]).

All CSS variables | Variable | Default | Purpose | |----------|---------|---------| | `--cm-color-primary` | `#333` | Main text | | `--cm-color-secondary` | `#6c757d` | Muted text | | `--cm-color-border` | `#ddd` | Borders | | `--cm-color-bg` | `#fff` | Surfaces | | `--cm-color-bg-hover` | `#f5f5f5` | Hover surfaces | | `--cm-color-bg-muted` | `#f8f9fa` | Muted surfaces (pills, buttons) | | `--cm-color-bg-active` | `#007bff` | Active filter / current page | | `--cm-color-text-on-active` | `#fff` | Text on active background | | `--cm-color-link` / `--cm-color-link-hover` | `#007bff` / `#0056b3` | Links | | `--cm-color-danger` | `#dc3545` | Clear-filters link | | `--cm-color-info-bg` | `#e3f2fd` | "Searching for" banner | | `--cm-color-shadow` | `rgba(0,0,0,.1)` | Card hover shadow | | `--cm-spacing-xs/sm/md/lg/xl` | `.25/.5/1/1.5/2rem` | Spacing scale | | `--cm-font-size-sm/base/lg` | `.875/1/1.125rem` | Type scale | | `--cm-border-radius-sm/md/pill` | `4px/8px/20px` | Radii | | `--cm-transition-fast/normal` | `.15s/.2s ease` | Transitions | | `--cm-search-max-width` | `400px` | Search field width | | `--cm-item-image-height` | `200px` | Card image height | | `--cm-pagination-button-size` | `2.5rem` | Pagination buttons | | `--cm-grid-min-width` | `280px` | Items grid min column |

2. Custom classes (Tailwind / UnoCSS / DaisyUI)

The classes config appends your utility classes to every element the plugin renders — the default BEM classes stay in place, so behavior, tests and the default stylesheet keep working:

Available keys: wrapper, search, searchInput, searchSubmit, searchClear, filters, filterGroup, filterLabel, filter, filterActive, filtersClear, sorting, sortingLabel, sortingSelect, items, item, empty, pagination, paginationItem, paginationIcon, indicator.

3. Custom snippets

For full control over the markup, override any snippet (see below).

How the AJAX layer works

The wrapper snippet loads a bundled htmx (once per page, however many instances there are) and every control targets the instance's content element. The server detects fragment requests through the HX-Target header, so URLs stay clean and shareable — a reload of any URL renders the full page. Fragment responses send Vary: HX-Target for cache correctness. Out-of-range page numbers (e.g. a stale link to page 3 of a filtered list) are clamped to the nearest valid page instead of erroring.

Translations

English, French and German are built in. Override or add languages in your config:

Demo & tests

A demo site lives in demo/ (requires a Kirby core in demo/kirby, not versioned). The Playwright end-to-end suite runs against it:

PHP linting: composer lint.

License

MIT


All versions of kirby-collection-manager with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
getkirby/composer-installer Version ^1.1
lukaskleinschmidt/kirby-snippet-controller Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shallowred/kirby-collection-manager contains the following files

Loading the files please wait ...