Cookbook
All recipes
-
A/B testing with Kirby
Split visitors into groups to compare how different versions perform.
-
A brief intro to object oriented programming in PHP
Understanding classes, objects, member functions and common pitfalls
-
Add authors to your pages
Tie pages to a person. Create an author system for your blog posts.
-
Art-directed pages
Add custom CSS and JavaScript to style individual pages without the need for additional templates.
-
A variant to using Kirby for multiple sites
An alternative approach for running multiple sites from the same Kirby installation.
-
Basic error hunting & prevention
When developing, debugging helps identify errors more easily.
-
Cleaning up content files
Remove unused fields from content files
-
Columns in Kirbytext
Add columns to your textarea fields with this KirbyTag plugin.
-
Creating a custom block type from scratch
New
A step-by-step guide to creating custom blocks with a preview using the example of an audio block with a poster and some additional settings.
-
Creating a Kirby-powered blog
Set up a blog system with an overview, articles, tags, feeds and more.
-
Creating pages from frontend
Create pages from user input on the front end, e.g. from an event registration form.
-
Custom content fields
Structure your content in the most flexible way with custom fields.
-
Custom homepage title
Set a unique title for the homepage.
-
Custom post types
Create different templates for different kinds of content.
-
Disabling the page cache for logged-in users
Customize pages for authenticated users while using the default page cache.
-
Dropbox sync
Set up Dropbox sync for your site (VPS or dedicated server required).
-
Editable redirects
Redirect visitors to external resources.
-
Email contact form
Create a basic contact form that sends HTML or plain text emails.
-
Email with attachments
Send an email with attachments from form input.
-
Examples for customizing the Panel
Style Panel elements via blueprint settings and custom CSS
-
Fetching field options
Get text labels for your option values from fields
-
Filter collections by tags
Classify content and make it easy for visitors to find related content.
-
Filtering compendium
Filter pages, files and users with Kirby's extensive filtering methods.
-
Filtering via routes
Learn how to filter using routes instead of parameters
-
Find translations in your code
Find and collect all your translations used with the t() helper function in your code.
-
First steps to start debugging with Xdebug
Xdebug helps you track down errors in your PHP scripts. In this recipe, we will set it up with VS Code.
-
Flexible language variables
Define language variables the way you need them.
-
Fun with loops and collections
Foreach loops are control structures useful in many contexts.
-
Generating JSON with Kirby
Create a JSON representation of your blog content in Kirby.
-
Going beyond Kirby's permissions features
Find out about ways to fine-tune and go beyond Kirby's built-in permission system in the Panel
-
Grouping collections
Group collections like articles, events or files by various criteria.
-
How to migrate file metadata
Update your file meta data for Kirby 3.
-
How to migrate users
Move your Kirby 2 user accounts over to Kirby 3.
-
How to upgrade from Kirby 2
Learn how to upgrade an existing project to Kirby 3.
-
How to upgrade Kirby 2 plugins
Adapt your existing plugins to Kirby 3's new plugin system.
-
How we built getkirby.com
Learn more about the hidden gems and secrets in our own website.
-
Import and export translations
Write scripts to import and export translations for external translators.
-
IndieAuth for your site
Log in to other sites with your domain via RelMeAuth/IndieAuth.
-
Kirby in a nutshell
Or what you wish you had known when you started your first Kirby project.
-
Kirby loves CDN
Set up custom components to deliver assets and files through a CDN.
-
Kirby meets Composer
Install and update Kirby via Composer.
-
Kirby meets Git
Install and update Kirby via Git
-
Kirby templates 101
Learn some PHP basics that make creating templates a breeze.
-
Load more with Ajax
New
Add a load more button to your listings and append items via Ajax.
-
Local development environment
Find the development environment that fits your needs.
-
Menu builders
Create custom menus from the Panel leveraging the power of the pages and the structure field
-
Menus
Create any kind of menu you need for your project.
-
Monolithic Plugin Setup
Set up a plugin workflow that allows you to both develop and test your plugin from the same Git repository.
-
My first Panel field
Create your first custom Panel field from scratch
-
My first Panel section
Let's build a custom Panel section
-
My first Panel view
Create your first custom Panel view from scratch
-
Of anchors and ToCs, part 1
Auto-replace headlines with anchors and generate a table of contents
-
One-pager site
Create a one-pager for small companies or simple portfolios.
-
Paginating long posts
Split long post into separate pages with pagination
-
Pagination
Use pagination to divide content into a list of digestible chunks.
-
Plugin test workflow with PHPUnit
Set up multiple plugins with PHPUnit testing under a single Kirby installation.
-
Previous / Next navigation
Create a previous/next navigation for your site.
-
Quicktip: Add blocks to a blocks field programmatically
Update a blocks field from the frontend, for example from form data
-
Quicktip: Don't repeat the same query multiple times
"Don't repeat yourself" (DRY) is a coding paradigm that when not heeded can seriously harm performance.
-
Quicktip: Filtering by language
Prevent fallback to default language if no translated content exist.
-
Quicktip: Fine-tuning cache settings
Control caching from a blueprint option or a field
-
Quicktip: Reusing KirbyTags in custom tags
Extend existing KirbyTags in custom tags with less hassle.
-
Quicktip: Serving a page on its own domain
Serve a single page of your site on its own separate domain.
-
Quicktip: Simple share buttons
Add basic Twitter and Facebook buttons to your site.
-
Quicktip: To slash or not to slash
How to enforce URLs with or without trailing slashes
-
Quicktip: Using placeholders in language strings
Make language translations more powerful with placeholders.
-
Random content
Simulate activity on your site by showing random content.
-
Related articles
Build relations between articles using YAML content and the pages field.
-
Restricting access to your site
Use Kirby’s authentication system to build login-protected pages.
-
Search
Learn how to build a simple search for your site or sections of your site.
-
Shared Controllers
Share the content of a controller across multiple templates
-
Sitemap for search engines
Automatically create a sitemap for search engines.
-
Sorting
Use Kirby's API to sort your content by all sorts of criteria.
-
Structured field content
Add structured data like addresses, events, etc. to your site.
-
Subpage builder
Auto-generate subpages when you create a new page
-
The order of KirbyText/KirbyTags hooks
When to use what type of KirbyText/KirbyTags hook
-
The power of placeholders
Use placeholders for recurring text snippets and more
-
Uploading files from frontend
Learn how to upload files through a frontend form.
-
Using blueprints in the frontend
Access blueprints and use this data to control your logic.
-
Using Kirby for multiple sites
Run multiple sites from the same Kirby installation.
-
Using MailHog for local email testing
Make email testing a breeze with the right tools for the task
-
Working with dates
Use dates in your content files and output different date formats.