Jump to content
David Duarte

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

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Wonderful. Thank you for sharing. Even small changes like this can make a bit difference in GUI design for users.

Share this post


Link to post
Share on other sites

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>

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines