This forum is archived. Posts are preserved for historical reference. For current help, join us on Discord.

Conditional colour for notifications

In UserSpice 4.3 and Below · Started by Moomintroll on 2018-12-13 10:42 am · 8361 views · 2 replies

Hi,
I'm just reviewing a site that I sent live last week, and I wondered if there was a tweak that could be made to the Notifications code that would keep the bubble grey if the count was 0, but turn it to a different colour if the count was >=1?
This is the line in includes/navigation.php (I think):
<li><a href="#" onclick="displayNotifications('new')" id="notificationsTrigger" data-toggle="modal" data-target="#notificationsModal"  ><i class="fa fa-fw fa-bell"></i> <span id="notifCount" class="badge" style="margin-top: -5px; background-color: #FF0004;"><?= (int)$notifications->getUnreadCount(); ?></span></a></li>
I added a background-color tag, but I'm not sure how to make it conditional and I'm not brave enough to do too much fiddling with a live site just yet...I'm afraid I'll break it!
You want to change the badge or the actually icon itself?

Brandin.
Hi Brandin,
Just the bubble that the figure sits in.