Skip to content

Commit

Permalink
Craft 5 refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Mar 24, 2024
1 parent 5a4b045 commit e2048a8
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 7,579 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
!.vscode/extensions.json
config.codekit3
prepros-6.config
composer.lock
15 changes: 15 additions & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Child Me! Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.0.0
### Added
- Added Craft 5 compatibility
- Added the `entry` attribute to the `mmikkel\childme\events\DefineEntryTypesEvent` event class
### Improved
- Child Me! has been rewritten from scratch for Craft 5 🔥
- Accessibility, performance and CX (child-creating experience) have all been improved 🎉
### Fixed
- Fixed an issue where Child Me! entry type menus could become visually cut off ([#14](https://github.com/mmikkel/ChildMe-Craft/issues/14))
89 changes: 6 additions & 83 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,89 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.3.3 - 2023-10-30
### Fixed
- Fixed a bug where the default entry type could be used for the Child Me! dropdown menu, even if it has been filtered out via an `EVENT_DEFINE_ENTRY_TYPES` event handler
- Fixed a bug where Child Me! buttons could be displayed in element index modals

## 1.3.2 - 2023-02-22
### Fixed
- Fixed some styling issues for the entry type menus on Craft 4.3

## 1.3.1 - 2022-05-07
### Changed
- Child Me! now defers any element queries to the `craft\web\Application::EVENT_INIT` event, avoiding potential issues with element queries being executed before Craft has fully initialised.

## 1.3.0 - 2022-04-05

## 2.0.0-beta.1 - 2024-03-24
### Added
- Added Craft 4.0 compatibility

### Fixed
- Fixes an issue where Child Me! would trigger the `EVENT_DEFINE_ENTRY_TYPES` event for all sections, not just structures

- Added Craft 5 compatibility
- Added the `entry` attribute to the `mmikkel\childme\events\DefineEntryTypesEvent` event class
### Improved
- Child Me!'s CSS and JS assets no longer outputs for pages rendered in control panel requests, if the template that rendered was in the site template folder.

### Changed
- Changed plugin icon
- Child Me! now requires Craft 3.7.0+

## 1.2.0 - 2020-11-21

### Added
- Added a new `EVENT_DEFINE_ENTRY_TYPES` event, giving modules and plugins a chance to modify the available entry types in Child Me!'s entry type menu

### Changed
- The "Add child" button in entry indexes no longer defaults to each entry's own type, but the first available entry type for the entry's section

## 1.1.2 - 2020-09-15
### Fixed
- Fixes an issue where Child Me! could fail to select the correct site on multisite installs, upon creating new categories or entries via the entry type menu

## 1.1.1 - 2020-05-05
### Fixed
- Fixes an issue where entry type menus would not be displayed for entries loaded in with AJAX on paginated entry indexes
- Fixes an issue where Child Me! could redirect to the wrong URL for multi-site installs

## 1.1.0 - 2020-03-08
### Fixed
- Fixes an issue where entry type menus could be cut off on Craft 3.4+
- Fixes issues with multi-site on Craft 3.2+

### Changed
- Child Me! now requires Craft 3.2.0

## 1.0.6 - 2019-10-21
### Fixed
- Fixes an issue where Child Me! could conflict with other plugins

## 1.0.5 - 2019-10-15
### Fixed
- Fixes an issue where sort order was not respected for entry types. Fixes #2

## Improved
- Reduces number of database queries in the Control Panel

## 1.0.4 - 2018-06-05
- Child Me! has been rewritten from scratch for Craft 5 🔥
- Accessibility, performance and CX (child-creating experience) have all been improved 🎉
### Fixed
- Fixes an issue where adding child entries in a multi-site install would always create children for the primary site

## 1.0.3 - 2018-05-23
### Improved
- Child Me! quickmenu now closes immediately when clicking outside the container

### Fixed
– Fixes an issue where the Child Me! JavaScript would get initialised multiple times

## 1.0.2 - 2018-05-23
### Improved
- Entry Type names are now translated using the "site" translation category

## 1.0.1 - 2018-05-01
### Improved
- Improves asset bundle loading to avoid conflicts with other plugins

## 1.0.0 - 2017-12-09
### Added
- Initial release
- Fixed an issue where Child Me! entry type menus could become visually cut off ([#14](https://github.com/mmikkel/ChildMe-Craft/issues/14))
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Child Me! plugin for Craft CMS

Child Me! adds an "Add child" element index attribute to structure indexes (entries and categories are supported). Adding this attribute to an index, renders a button that works as a "shortcut" to create new child
Child Me! adds an "New child" element index attribute to structure indexes (entries and categories are supported). Adding this attribute to an index, renders a button that works as a "shortcut" to create new child
elements nested under a particular parent – making it much easier to add a child element to a particular parent.

For structure sections with multiple entry types, the Child Me! button displays a menu, giving authors quick access to create a child entry using a particular entry type, as well.
Expand All @@ -27,18 +27,18 @@ To install the plugin, follow these instructions.

## Using Child Me!

To actually use Child Me!, you'll need to add the "Add child" element index attribute manually, using the CEI (
To actually use Child Me!, you'll need to add the "New child" element index attribute manually, using the CEI (
Customizable Element Index) feature available in entry and category element indexes:

Simply click the little cogwheel below your element sources in the left-side panel, check the "Add child" attribute,
Simply click the little cogwheel below your element sources in the left-side panel, check the "New child" attribute,
drag it to the position you want and hit "Save" (see screenshot for reference).

### 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 "Add child" button, for sections with multiple entry types. Example:
entry types via the "New child" button, for sections with multiple entry types. Example:

```php
\yii\base\Event::on(
Expand Down
9 changes: 3 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mmikkel/child-me",
"description": "Easily create child elements",
"type": "craft-plugin",
"version": "1.3.3",
"version": "2.0.0-beta.1",
"keywords": [
"craft",
"cms",
Expand All @@ -22,11 +22,8 @@
}
],
"require": {
"craftcms/cms": "^3.7.0|^4.0.0-beta.3",
"php": "^7.2.5|^8.0"
},
"require-dev": {
"craftcms/rector": "dev-main"
"craftcms/cms": "^5.0.0-beta.11",
"php": "^8.2"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
Loading

0 comments on commit e2048a8

Please sign in to comment.