Jump to content

Notifications customization


Recommended Posts

Hello there,

On V 7.6 we now have the notifications NEW string ready for translation.

Before having this option available, we decided to replace the text NEW by the number of notifications, as we think this can easily attract the user attention.

On this minimalistic version, if the user don't have any notification the div is not displayed, we only show what needs to be shown 😉

Feel free to use it.

     {if count($clientAlerts) > 0}
     <div class="notifications">
 <li>
                    <a href="#" data-toggle="popover" id="accountNotifications" data-placement="bottom">
                        {$LANG.notifications}
                        <span class="label label-info">{count($clientAlerts)}</span>
                        <b class="caret"></b>
                    </a>
                    <div id="accountNotificationsContent" class="hidden">
                        <ul class="client-alerts">
                        {foreach $clientAlerts as $alert}
                            <li>
                                <a href="{$alert->getLink()}">
                                    <i class="fas fa-fw fa-{if $alert->getSeverity() == 'danger'}exclamation-circle{elseif $alert->getSeverity() == 'warning'}exclamation-triangle{elseif $alert->getSeverity() == 'info'}info-circle{else}check-circle{/if}"></i>
                                    <div class="message">{$alert->getMessage()}</div>
                                </a>
                            </li>
                        {foreachelse}
                            <li class="none">
                                {$LANG.notificationsnone}
                            </li>
                        {/foreach}
                        </ul>
                    </div>
                </li></div>{else}<br /><br />{/if}

Best regards,

David Duarte

notifications_customization_1.jpg

notifications_customization_2.jpg

notifications_customization_3.jpg

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Good idea... I'm taking it. 😀

For anyone else willing to go straight to it:

The file is in templates/{yourtheme}/header.tpl

Search this line:

<span class="label label-info">{lang key='notificationsnew'}</span>

And replace it with:

<span class="label label-info">{count($clientAlerts)}</span>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated