Skip to content

Conversation

@i-just
Copy link
Contributor

@i-just i-just commented May 30, 2025

Description

This PR:

  • moves the selection of entry types from field settings to CKE config settings
  • adds the ability to choose which entry type should show as a standalone button and which in a dropdown
  • gives the ability to choose if entry type should show as icon/text/icon+text (if the entry type has an icon specified)
  • each standalone entry type button and the dropdown button are now separate and move to the overflow dropdown one by one

A migration moves the entry types from the field to the CKE config. If multiple fields use the same config but different entry types (completely different, same but in different order, same but with overwritten names or handles), the CKE config will be duplicated, and the entry types from the field will be used.

If the field has expandEntryButtons set to true, all the entry types with icons will be set to show as separate buttons during migration.

Screenshot 2025-05-30 at 15 40 52

@gcamacho079 and I are discussing colours and accessibility. Once we’re in agreement, the way we handle colours for entry types might change. update: colours now account for the minimum contrast requirements.

Added:

  • craft\ckeditor\CkeConfig::getEntryTypes()
  • craft\ckeditor\CkeConfig::setEntryTypes()
  • craft\ckeditor\CkeConfig::getEntryTypeOptions()
  • craft\ckeditor\models\EntryType
  • craft\ckeditor\controllers\CkeConfigsController::actionApplyEntryTypeIndicators()
  • craft\ckeditor\helpers/CkeditorConfig::getCkeEntryType()

Removed:

  • craft\ckeditor\Field::$createButtonLabel
  • craft\ckeditor\Field::$expandEntryButtons
  • craft\ckeditor\Field::getEntryTypes()
  • craft\ckeditor\Field::setEntryTypes()

Changed:

  • craft\ckeditor\CkeConfigs::getByUid() now has a second, optional parameter

Related issues

cms-2776

Requires craftcms/cms#17387 to be merged into cms v5.

@linear
Copy link

linear bot commented May 30, 2025

@i-just i-just marked this pull request as ready for review June 12, 2025 13:50
@i-just i-just requested a review from brandonkelly as a code owner June 12, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants