localgovdrupal / localgov_alert_banner

Alert banner module for LocalGovDrupal
GNU General Public License v2.0
5 stars 8 forks source link

Provide a hook or event subscriber for modifying the current alert banners #262

Open andybroomfield opened 1 year ago

andybroomfield commented 1 year ago

Provide a method for altering the alert banners that are displayed programmatically, not just through condition field. This is to account for scenarios whereby

My initial thinking would be either a hook or an event subscriber so this is then available for devs to create the appropriate custom module to meet their needs, interested in others thoughts.

andybroomfield commented 1 year ago

Whats the best name for the hook? localgov_alert_banner_banner_alter? Anything needed to provide to the hooks apart from the banners? This will be run the point where currentBanners is called (currently in the block) though it might be desirable to pass some context.

andybroomfield commented 3 months ago

Suggestions:

all a bit long, but follows the pattern.

andybroomfield commented 2 months ago

An event subscriber is proabbly better, otherwise the hook names will be quite long.