PHPackages                             oblik/kirby-outsource - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. oblik/kirby-outsource

Abandoned → [oblik/kirby-walker](/?search=oblik%2Fkirby-walker)Kirby-plugin[Utility &amp; Helpers](/categories/utility)

oblik/kirby-outsource
=====================

Kirby 3 plugin for exporting, importing, and iterating over site content.

3.0.0(3y ago)1656MITPHPCI failing

Since Sep 24Pushed 2y ago4 watchersCompare

[ Source](https://github.com/OblikStudio/kirby-walker)[ Packagist](https://packagist.org/packages/oblik/kirby-outsource)[ RSS](/packages/oblik-kirby-outsource/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (6)Versions (8)Used By (0)

Walker
======

[](#walker)

Plugin that allows you to walk, export, and import all site data according to specified blueprints. It is created with the intention of being used as a dependency for other plugins. Features:

- Serialize content on a per-field basis (parse YAML in structures, turn comma-separated tags fields to arrays, etc.)
- Convert KirbyTags to XML and back (for consumption by another API that doesn't understand KirbyTag syntax)
- Convert Markdown to HTML and back (for APIs that don't work with Markdown)
- Export entire site, page, and file models
- Import content using the same schema as the exports
- Traverse blocks and structures according to their `id` fields (if they have such)
- Easy extensibility of the PHP classes for implementing custom behavior
- Support for the now deprecated [Kirby Editor](https://github.com/getkirby/editor)

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

[](#installation)

With Composer from [oblik/kirby-walker on Packagist](http://packagist.org/packages/oblik/kirby-walker):

```
composer require oblik/kirby-walker

```

Usage
-----

[](#usage)

#### Exporting

[](#exporting)

You can use the `Exporter` class to export content:

```
use Oblik\Walker\Walker\Exporter;

$exporter = new Exporter();
$result = $exporter->walk(page('home'));
echo json_encode($result, JSON_PRETTY_PRINT);
```

```
{
    "title": "Home",
    "headline": "Welcome to Kirby's Starterkit",
    "subheadline": "A fully documented example project"
}
```

#### Importing

[](#importing)

You can use the `Importer` class to merge input content with the current model content.

```
use Oblik\Walker\Walker\Importer;

$importer = new Importer();
$model = page('home');
$result = $importer->walk($model, [
	'input' => [
		'headline' => 'Updated headline!'
	]
]);
echo json_encode($data, JSON_PRETTY_PRINT);
```

```
{
    "title": "Home",
    "headline": "Updated headline!",
    "subheadline": "A fully documented example project"
}
```

After merging the data, you can use the resulting array to apply the changes to the model:

```
kirby()->impersonate('kirby');
$model->update($result);
```

Options
-------

[](#options)

There are a few options that allow you to transform the raw content to make it more suitable for other systems. Then, the plugin can turn that reformatted content back to its original format, while keeping any changes made to it.

### Parse KirbyTags

[](#parse-kirbytags)

Turns KirbyTags to XML:

```
Subheadline: A fully (link: https://getkirby.com/docs/guide text: documented target: _blank) example project

```

```
$exporter->walk(page('home'), [
	'options' => [
		'parseKirbyTags' => true
	]
]);
```

```
{
    "subheadline": "A fully  example project"
}
```

By default, KirbyTag attributes are encoded as XML attributes. If the consuming system needs to operate on those values (e.g. translate them), you might need to put their contents out of the tags. Instead of this:

```

```

…you might need this:

```

    documented

```

To do this, just use the `externalAttributes` setting:

```
$exporter->walk(page('home'), [
	'options' => [
		'parseKirbyTags' => [
			'externalAttributes' => ['text']
		]
	]
]);
```

```
{
    "subheadline": "A fully documented example project"
}
```

### Parse Markdown

[](#parse-markdown)

If the consuming system doesn't understand Markdown, you can turn it to HTML:

```
Text:

# Hello World

This is a fully **documented** example project!

```

```
$exporter->walk(page('home'), [
	'options' => [
		'parseMarkdown' => true
	]
]);
```

```
{
    "text": "Hello WorldThis is a fully documented example project!"
}
```

**Note:** This applies only to `textarea` field types.

### Parse templates

[](#parse-templates)

Turns content enclosed in curly braces to XML:

```
Title: {{ site.title }} Home

```

```
$exporter->walk(page('home'), [
	'options' => [
		'parseTemplates' => true
	]
]);
```

```
{
    "title": " Home"
}
```

Extending
---------

[](#extending)

You can easily extend the base classes to add custom behaviors. For example, you could return the character lengths of each field like so:

```
use Oblik\Walker\Walker\Walker;

class CustomWalker extends Walker
{
	protected function walkText(string $text, $context)
	{
		return strlen($text);
	}
}

$walker = new CustomWalker();
$data = $walker->walk(page('home'));
echo json_encode($data, JSON_PRETTY_PRINT);
```

```
{
    "title": 4,
    "headline": 29,
    "subheadline": 34
}
```

You could also use values from each field's blueprint:

```
class CustomWalker extends Walker
{
	protected function walkField(Field $field, $context)
	{
		return $context['blueprint']['label'] ?? 'NONE';
	}
}
```

```
{
    "title": "NONE",
    "headline": "Headline",
    "gap": "Gap",
    "subheadline": "Subheadline"
}
```

The cool part is that parsing YAML for structure fields and JSON for layout and blocks fields is already handled. Your custom logic will work in all nested fields automatically.

### Separate logic for field types

[](#separate-logic-for-field-types)

You can have different logic for different field types by adding a `walkField{{ field type }}` method. For example, you can change the behavior for just the `gap` fields by adding `walkFieldGap`:

```
class CustomWalker extends Walker
{
	protected function walkFieldGap($field, $context)
	{
		return 'Mind the gap!';
	}
}
```

```
{
    "title": "Home",
    "headline": "Welcome to Kirby's Starterkit",
    "gap": "Mind the gap!",
    "subheadline": "A fully documented example project"
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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

Every ~277 days

Total

5

Last Release

1311d ago

Major Versions

1.0.2 → 2.0.02020-09-03

2.0.0 → 3.0.02022-10-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/078077710a1481f0419521ab1e1d3e5f93723aadd56148937ee3e355b93acb2e?d=identicon)[hdodov](/maintainers/hdodov)

---

Top Contributors

[![yandodov](https://avatars.githubusercontent.com/u/5570098?v=4)](https://github.com/yandodov "yandodov (248 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")

---

Tags

exportimportkirbykirby-plugintraversewalk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oblik-kirby-outsource/health.svg)

```
[![Health](https://phpackages.com/badges/oblik-kirby-outsource/health.svg)](https://phpackages.com/packages/oblik-kirby-outsource)
```

###  Alternatives

[belugadigital/kirby-navigation

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

8713.4k](/packages/belugadigital-kirby-navigation)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4144.1k1](/packages/bnomei-kirby3-dotenv)[tobimori/kirby-icon-field

A simple Icon field plugin for Kirby CMS

5117.1k1](/packages/tobimori-kirby-icon-field)[tobimori/kirby-tailwind-merge

Tailwind Merge for Kirby CMS

276.3k](/packages/tobimori-kirby-tailwind-merge)[beebmx/kirby-env

Enable env variables to Kirby

2037.9k2](/packages/beebmx-kirby-env)[bnomei/kirby3-recently-modified

Kirby Section to display recently modified content pages

309.3k](/packages/bnomei-kirby3-recently-modified)

PHPackages © 2026

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