Custom notification

2 replies · opened Jul 7, 2020

SswwammpJul 7, 2020

Hi Semicolon,

Brilliant template you made, thanks again for that.
I just finally found the notification built in (docs/shortcodes/notifications/) - however it does not show up on shortcodes etc. but only in docs one place.

I'd love to use it, looks great, but: I'd need to call it from jquery (I'd got the text to be shown as a result of ajax call).
Is it possible to call it without the need of having a div somewhere, but simply calling a function with passing 3 parameters (html format text, position and options (success, warning etc.))?

Thanks very much.
A.

SSemicolon WebSTAFFJul 8, 2020

Hello,

Thanks so much for the Kind Words! :)

You can find the Notifications example here: http://themes.semicolonweb.com/html/canvas/modal-popovers.html .

This is Definitely Possible:

  1. Add a Blank HTML Notification Selector on the Page:
  1. Return the AJAX result using JSON:

{ "alert": "success", "position": "top-right", "message": "Your Message" }
  1. Then call the Notification Function inside AJAX Success:

$('#ajax-result-notification').attr( 'data-notify-type', data.alert ).attr( 'data-notify-position', data.position ).attr( 'data-notify-msg', data.message ).html('');
SEMICOLON.widget.notifications({ el: $('#ajax-result-notification') });

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SswwammpJul 8, 2020

Wow, brilliant, thanks so much!
A.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard