How do I implement a stackable event plugin with one backend menu option?
Posted: Tue Nov 17, 2020 1:13 pm
I'm working on a stackable event plugin that should provide three different views and only one backend menu option. The event plugin allows the selection of a view and is therefore installed three times with a different view selection each.
In this setup and without any checks each installed event plugin adds the backend menu option for administration once making it appear three times overall.
At the moment I check for one specific view and add the backend menu option only if this view is selected. This requires one and only one plugin with this specific view selection.
Another approach would be to add another configuration option for the event plugin to enable adding of the backend menu option only in one of the installed plugins. This would require at least one plugin with no particular view selected.
Or I could add another view just for the backend menu option and check for this selection. This would completely remove the dependency of the backend menu option from the event plugin. Configuration options like permalink and pagetitle should then be ignored in events plugin configuration which is not very user-friendly.
Or I could even create two different plugins which is something i don't want to do.
Is there any best practise how to add a backend menu option only once if the event plugin is stackable?
In this setup and without any checks each installed event plugin adds the backend menu option for administration once making it appear three times overall.
At the moment I check for one specific view and add the backend menu option only if this view is selected. This requires one and only one plugin with this specific view selection.
Another approach would be to add another configuration option for the event plugin to enable adding of the backend menu option only in one of the installed plugins. This would require at least one plugin with no particular view selected.
Or I could add another view just for the backend menu option and check for this selection. This would completely remove the dependency of the backend menu option from the event plugin. Configuration options like permalink and pagetitle should then be ignored in events plugin configuration which is not very user-friendly.
Or I could even create two different plugins which is something i don't want to do.
Is there any best practise how to add a backend menu option only once if the event plugin is stackable?