Skip to content

Icons and component chips/selects #14169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jan 22, 2024
Merged

Conversation

brandonkelly
Copy link
Member

Icons

  • Adds a new SVG system icon pack, made up of a subset of Font Awesome 6.5.1 (solid).
    • The icon font has been updated with new FA counterparts for backwards compatibility. No new icons are being added to the font here. The SVGs should be used in general going forward.
  • Adds iconPicker and iconPickerField form macros, as well as craft\helpers\Cp::iconPicker() and iconPickerField() methods.
  • Adds craft\helpers\Cp::iconSvg() and a corresponding iconSvg() global Twig function for CP templates, which accept a system icon name, an icon SVG path, or an icon’s raw SVG markup.
    • craft\helpers\Component::iconSvg() is still there, but deprecated.
  • All system components that support icons can now return a system icon name.
  • Adds a new “Icon” field type.
  • Adds an “Icon” entry type setting.
  • Entries’ Entry Type settings and Matrix fields’ entry type menus will now display entry type icons.
the “New entry” menu for a Matrix field, showing seven available entry types, each with a custom icon next to them.

Component chips/selects

  • Adds new interfaces:
    • Identifiable – for components which can be fetched via an ID
    • Chippable – for components that want to support being rendered as chips
    • Actionable – for defining chip action menus
    • Iconic – for defining chip icons
    • Statusable - for defining chip statuses
    • Thumbable - for defining chip thumbnails
  • Adds craft\helpers\Cp::chipHtml() for rendering a Chippable component’s chip.
  • Adds componentSelect and componentSelectField macros for rendering an element select-style input for any Chippable components, complete with inline component creation.
  • Component chips automatically get updated whenever they component is saved, like element selects.
  • Sections’ and Matrix fields’ Entry Types settings now use component select inputs rather than Selectize.
a section’s Entry Types setting, showing two selected entry types, a “Choose” menu button, and a “Create” button.

Copy link

linear bot commented Jan 22, 2024

@brandonkelly brandonkelly merged commit fab5ed5 into 5.0 Jan 22, 2024
@brandonkelly brandonkelly deleted the feature/cms-1232-entry-type-icons branch January 22, 2024 04:43
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.

1 participant