mmikkel/child-me 问题修复 & 功能扩展

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

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

mmikkel/child-me

最新稳定版本:2.2.3

Composer 安装命令:

composer require mmikkel/child-me

包简介

Easily create child elements

README 文档

README

Child Me! improves Craft's CX (child-creating experience) by making a nifty "New child" element index attribute available to element indexes.

Adding the "New child" attribute to a structure section or category index renders a button, which works as a "shortcut" for creating new child elements nested under a particular parent – much faster than manually selecting the parent in the "Parent" field on element edit pages!

For structure sections with multiple entry types available, the Child Me! button opens a disclosure menu with shortcuts for creating child entries using these types.

Screenshot

Requirements

This plugin requires Craft CMS 5.0+

Using Child Me!

Child Me! works by adding the "New child" element index attribute to a structure section or category index.

To add the attribute, click the "Customize sources" disclosure menu toggle below your element sources in the left-side panel, then select the appropriate section and finally check the "New child" attribute.

Customize sources button

Events

EVENT_DEFINE_ENTRY_TYPES

Child Me! triggers an event when creating entry type menus, giving plugins and modules a chance to modify the available entry types via the "New child" button, for sections with multiple entry types. Example:

\yii\base\Event::on(
    \mmikkel\childme\ChildMe::class,
    \mmikkel\childme\ChildMe::EVENT_DEFINE_ENTRY_TYPES,
    static function (\mmikkel\childme\events\DefineEntryTypesEvent $event) {
       // Only care about entries in the "Some Structure" section
       if ($event->section !== 'someStructure') {
           return;
       }
       // Make sure that the default entry type is not included
       $event->entryTypes = \array_filter($event->entryTypes, function (EntryType $entryType) {
           return $entryType->handle !== 'default';
       });
    }
);

Disclaimer

Please report any bugs or other issues here.

Plugin icon: Baby by Chintuza from the Noun Project

统计信息

  • 总下载量: 48.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-09