8.4.2: how to make a dismissable alert?

Permalink
Here's a normal alert:
<div class="alert alert-danger">
    <?php echo t('This is an alert'); ?>
</div>

How can I make it dismissable?

linuxoid
 
linuxoid replied on at Permalink Reply
linuxoid
Looks like adding the button does the trick:
<div class="alert alert-success">
    <?php echo t('This is an alert'); ?>
    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">×</span>
    </button>
</div>
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi linuxoid,

My reply is a bit late, but you can find more information on notifications in this tutorial.
https://documentation.concrete5.org/tutorials/how-to-create-alert-no...

I wrote the initial version and community member mnakalay expanded on some of the explanations. If you find any information missing, feel free to add to it.
linuxoid replied on at Permalink Reply 1 Attachment
linuxoid
Hi MrKDilkington,

I was wondering about the Bootstrap alert (that kind attached), not a PNotify alert.

As to the PNotify alerts, they only work for registered users. I could not find any easy way of showing them for non-registered users without rewriting them myself from scratch. It would be great if this is not the case and the Howto can be updated.