Skip to content
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

Provide an event to modify available entry types on entry edit page #7136

Closed
Mosnar opened this issue Nov 15, 2020 · 2 comments
Closed

Provide an event to modify available entry types on entry edit page #7136

Mosnar opened this issue Nov 15, 2020 · 2 comments
Labels
enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev
Milestone

Comments

@Mosnar
Copy link
Contributor

Mosnar commented Nov 15, 2020

Description

Currently (as of Craft 3.5.15), there's no straight-forward way to modify the entry types available to a certain section. Adding an event to modify these would be great for:

  • Non-standard requirements for permissions
  • Restricting entry types based on site (especially useful for scenarios where not all page types are available on all sites)

Related Issues

#955
#853
#1628
#971

@brandonkelly brandonkelly added enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev and removed enhancement labels Nov 16, 2020
@brandonkelly brandonkelly added this to the 3.6 milestone Nov 17, 2020
@brandonkelly
Copy link
Member

Just added a new EVENT_DEFINE_ENTRY_TYPES event for 3.6:

Event::on(
    Entry::class,
    Entry::EVENT_DEFINE_ENTRY_TYPES,
    function(DefineEntryTypesEvent $event) {
        /** @var Entry $entry */
        $entry = $event->sender;
        $event->entryTypes = // ...
    }
);

@brandonkelly
Copy link
Member

Craft 3.6 has now been officially released ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev
Projects
None yet
Development

No branches or pull requests

2 participants