If you’re not familiar with AlertsDLX, it’s a neat, free plugin that allows you to insert banners, callouts, and notifications easily. AlertsDLX is more powerful with its 2.0 release, which includes dismissals, custom colors, and flexible innerblocks. Let’s go over what’s new.
Dismissals have arrived
A user on Twitter requested that I add dismissals to AlertsDLX. When you combine this with a plugin like Block Visibility, the possibilities are wide open.
You’ll find a few new options when editing the block.
For shortcode users, you’ll find a few new arguments, which are detailed in the shortcode docs:
- close_button_enabled – Whether to show the close button (true or false)
- close_button_expiration – Time in seconds to save the close behavior. Set to 0 to never remember any expiration.
Here’s an example shortcode:
[alertsdlx alert_group="bootstrap" close_button_enabled="true" close_button_expiration="604800"]Alert Description[/alertsdlx]
Code language: plaintext (plaintext)
Bootstrap gets dark mode
You’ll find a new option for dark mode when you select the Bootstrap block or shortcode. Shown above is an example Bootstrap alert with light and dark mode.
Custom colors are here
You can now select a set of custom colors for each alert type.
Custom colors will show below in the block sidebar settings.
For shortcode users, there are several new arguments:
- color_primary (primarily used for the text color)
- color_border
- color_accent (used for the button background color)
- color_alt (used as a hover color for the button)
- color_bold (used as an icon color)
- color_light (primarily used as a background color)
Here’s an example shortcode:
[alertsdlx alert_group="bootstrap" alert_type="custom" color_primary="#333" color_border="#000" color_accent="#035e88" color_alt="#0277bd" color_bold="#03a9f4" color_light="#e5f6fd"]Alert Description[/alertsdlx]
Code language: plaintext (plaintext)
Flexible and advanced innerblocks
You can now choose flexible innerblocks in the block’s Advanced setting.
With Flexible Innerblocks, you can input any block within the alert. If you enable this option, you will be responsible for styling.
Here’s an example of a code block inside AlertsDLX.
Conclusion
This is a packed release. Please try AlertsDLX with Block Visibility if you haven’t already.
Like this tutorial? There's more like it. Subscribe today!
Ronald Huereca founded DLX Plugins in 2022 with the goal of providing deluxe plugins available for download. Find out more about DLX Plugins, check out some tutorials, and check out our plugins.