Skip to content

Get the field of the parent pages if it's empty or not exists. It goes all up till the site.

License

Notifications You must be signed in to change notification settings

plain-solutions-gmbh/kirby-inherit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kirby Inherit

Get the field of the parent pages if it's empty or not exists. It goes all up till the site.

Overview

This plugin is free to use and published under the MIT license. If you use this plugin for commercial purposes, or you want to show your appreciation. support me with a donation.

Installation

Manually

Download and copy the plugin into your plugin folder: /site/plugins/

With Composer

composer require microman/kirby-inherit

How to use

Let's say you want to get a hero image. The editor can set it on each page. But he don't have an image for every page. Use this code to look if the parent page has a image set:

    $page->hero_image()->inherit()

It goes all way up. At the end it will take the imgae from the main site.

Inherit form another page

You can also use it for another page:

    $page->hero_image()->inherit( page('another_site') )

License

MIT

Do you like this Plugin? Buy me a ☕️

About

Get the field of the parent pages if it's empty or not exists. It goes all up till the site.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages