PDA

View Full Version : 2 notification areas, but only 1 functioning


Hornstar
04-01-2011, 10:23 PM
Hi all, I need a little help in getting this to work.

I have 2 notification menus on my site.

1 in header
1 in navbar

May seem odd to have 2, but that is just how things are ^^

The problem tho, is that the dropdown for the header one is not working. Only the navbar one works.

This is the code in the header:

<if condition="$show['notifications']">
<div><span id="notifications1"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a>
<strong>$notifications_total</strong></span></div>
<script type="text/javascript"> vBmenu.register("notifications"); </script>
<else /><if condition="$show['pmstats']">
<div><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></div>
</if></if>








And this is the code in the navbar:


<if condition="$show['notifications']">
<div><span id="notifications"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a> <strong>$notifications_total</strong></span></div>
<if condition="$show['popups']">
<script type="text/javascript"> vBmenu.register("notifications"); </script>
<else />
<script type="text/javascript" src="clientscript/vbulletin_notifications_nopopups.js?v=$vboptions[simpleversion]"></script>
<script type="text/javascript"> vBulletin.register_control("vB_Notifications_NoPopups", "notifications"); </script>
</if>



... down further




<if condition="$show['member'] AND $notifications_total">
<!-- notifications menu -->
<div class="vbmenu_popup" id="notifications_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead" colspan="2">$vbphrase[your_notifications]</td></tr>
$notifications_menubits
</table>
</div>
<!-- / notifications menu -->
</if>
I am sure it is a simple fix, but I am just a little stumped.

Note: I changed id="notifications" in the header one to id="notifications1" otherwise it would not have had a drop down arrow. So now I have the arrow, but it won't actually drop down.

Thanks for any help.
Matt

Lynne
04-02-2011, 03:03 AM
As you found, you can't use the same id in two places on a page. However, the id may be something that is needed for the javascript, so you may to change other parts of the area that use that id in the id for the area. (there is an article about dropdowns that explains this - look it up in the articles area)

Hornstar
04-02-2011, 09:22 PM
Thanks, yeah I had to create an extra notification menu, and than change all the ID tags and javascript references to reflect the new ID tag created in the new notification menu.