plain/kirby-inherit 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

plain/kirby-inherit

最新稳定版本:2.0.4

Composer 安装命令:

composer require plain/kirby-inherit

包简介

Get field from parent page if empty

README 文档

README

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

Installation

Manually

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

With Composer

composer require plain/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

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

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-01