PHPackages                             swiegmann/kirby-alternate-snippets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. swiegmann/kirby-alternate-snippets

ActiveKirby-plugin

swiegmann/kirby-alternate-snippets
==================================

This Kirby CMS-Plugin applies custom snippets based on slugs.

1.0.0(5mo ago)10MITPHPPHP &gt;=8.1.0 &lt;8.4.0

Since Nov 14Pushed 5mo agoCompare

[ Source](https://github.com/swiegmann/kirby-alternate-snippets)[ Packagist](https://packagist.org/packages/swiegmann/kirby-alternate-snippets)[ Docs](https://github.com/swiegmann/kirby-alternate-snippets)[ RSS](/packages/swiegmann-kirby-alternate-snippets/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Kirby Alternate Snippets
========================

[](#kirby-alternate-snippets)

This [Kirby CMS](https://www.getkirby.com)-Plugin applies custom snippets based on slugs.

Summary
-------

[](#summary)

- Replaces any snippet for a given slug
- Supports descendant pathes
- Supports multilanguage-setups
- Advantages:
    - Control of the frontend output (aka "Art Direction") without content/data-changes in the backend
- Disadvantages:
    - In case of slug-changes the snippets must be renamed according the current path

Prerequisites
-------------

[](#prerequisites)

- Kirby 4+

Installation
------------

[](#installation)

### Download

[](#download)

Download and copy this repository to `/site/plugins/kirby-alternate-snippets`.

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/swiegmann/kirby-alternate-snippets.git site/plugins/kirby-alternate-snippets

```

### Composer

[](#composer)

```
composer require swiegmann/kirby-alternate-snippets

```

Use-Case
--------

[](#use-case)

You have a snippet-file, e.g. `/site/snippets/header.php` and want to use a custom snippet for a given slug, e.g. `domain.com/some-path/another-path`.

Usage
-----

[](#usage)

Copy the snippet file with one of the following filenames to apply the snippet to

#### ... exactly the slug:

[](#-exactly-the-slug)

```
/site/snippets/[snippet-name]--[slug].php

```

*e.g.: /site/snippets/header--news.php*.

You can always apply it to deeper slug-pathes:

```
/site/snippets/[snippet-name]--[slug]--[slug].php

```

*e.g.: /site/snippets/header--news--culture.php.*

#### ... the slug and all subpages of the path:

[](#-the-slug-and-all-subpages-of-the-path)

```
/site/snippets/[snippet-name]--[slug]--.php

```

*e.g.: site/snippets/header--news--.php*.

#### ... exactly the slug for a specific language:

[](#-exactly-the-slug-for-a-specific-language)

```
/site/snippets/[snippet-name]--[slug]--[language-code].php

```

*e.g.: site/snippets/header--news--en.php*.

#### ... the slug and all subpages of path for a specific language:

[](#-the-slug-and-all-subpages-of-path-for-a-specific-language)

```
/site/snippets/[snippet-name]--[slug]--[language-code]--.php

```

*e.g.: site/snippets/header--news--en--.php*.

Global Configuration
--------------------

[](#global-configuration)

Configure global settings in your `config.php` file:

```
return [
  'swiegmann.kirby-alternate-snippets' => [
    'enabled' => true
  ]
];
```

OptionDefaultTypeDescription`enabled``true`boolEn-/Disable pluginLicense
-------

[](#license)

[MIT License](https://github.com/swiegmann/kirby-menu/blob/main/LICENSE) Copyright © 2025-present swiegmann

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance69

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

179d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f883f2015da18a2867f0fad57b3bb932a06078a6b0951ed6662bed8b972ae5b3?d=identicon)[swiegmann](/maintainers/swiegmann)

---

Top Contributors

[![swiegmann](https://avatars.githubusercontent.com/u/39836887?v=4)](https://github.com/swiegmann "swiegmann (1 commits)")

---

Tags

kirby-cmskirby-pluginkirby4kirby5snippetskirbykirby-plugin

### Embed Badge

![Health badge](/badges/swiegmann-kirby-alternate-snippets/health.svg)

```
[![Health](https://phpackages.com/badges/swiegmann-kirby-alternate-snippets/health.svg)](https://phpackages.com/packages/swiegmann-kirby-alternate-snippets)
```

###  Alternatives

[oblik/kirby-link-field

Kirby 4 field for all types of links.

7650.6k2](/packages/oblik-kirby-link-field)[belugadigital/kirby-navigation

Kirby 5 field for hierarchical menus with drag &amp; drop level indentation.

8713.4k](/packages/belugadigital-kirby-navigation)[tobimori/kirby-tailwind-merge

Tailwind Merge for Kirby CMS

276.3k](/packages/tobimori-kirby-tailwind-merge)[leitsch/kirby-blade

Enable Laravel Blade Template Engine for Kirby 4 and Kirby 5

219.2k](/packages/leitsch-kirby-blade)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
