menu dropdown
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #6
RE: menu dropdown
Hi there, this is the code I use in my dropdown menu:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<br />
<div>
			<strong><span><a href="#" id="forumlink_{$memprofile['uid']}">Site Areas&nbsp;<img src="{$mybb->settings['bburl']}/mybb/images/NewFish/thing.gif" alt="Click to View Site Links"/></a></span></strong>
				<div id="forumlink_{$memprofile['uid']}_popup" class="popup_menu" style="display: none;"><span></span>				
					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/portal.php" class="popup_item"><span class="smalltext">Home Page</span></a>
					</div>
			                <div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/index.php" class="popup_item"><span class="smalltext">All Areas</span></a>
					</div>
                                        <div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/forumdisplay.php?fid=1" class="popup_item"><span class="smalltext">The Bowl</span></a>
					</div>

					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/forumdisplay.php?fid=6" class="popup_item"><span class="smalltext">SimFish</span></a>
					</div>

					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/forumdisplay.php?fid=3" class="popup_item"><span class="smalltext">Random Fish</span></a>
					</div>

					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/forumdisplay.php?fid=9" class="popup_item"><span class="smalltext">Code Fish</span></a>
					</div>
					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/games.php" class="popup_item"><span class="smalltext">Games Section</span></a>
					</div>
						
	        		</div>
					<script type="text/javascript">

					<!--

					new PopupMenu("forumlink_{$memprofile['uid']}");

					// -->

					</script>
			</div>


You will see that I use "forumlink" 3 times in this code; you can call your link whatever you like, but it must be called the same in all 3 instances.

I have this as a separate template which is linked to my header. If you wanted it in the default header you would have this:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<div id="container">
		<a name="top" id="top"></a>
		<div id="header">
			<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>
			<div class="menu">
				<ul>
					<li><a href="{$mybb->settings['bburl']}/search.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li>
					<li><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/memberlist.gif" alt="" title="" />{$lang->toplinks_memberlist}</a></li>
					<li><a href="{$mybb->settings['bburl']}/calendar.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/calendar.gif" alt="" title="" />{$lang->toplinks_calendar}</a></li>
					<li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/help.gif" alt="" title="" />{$lang->toplinks_help}</a></li>
				</ul>
			</div>
			<hr class="hidden" />
			<div id="panel">
				{$welcomeblock}
			</div>
		</div>
<table><tr>
	<td>{$site_links}</td>
	<td>{$help_links}</td>
</tr></table>
		<hr class="hidden" />
		<br class="clear" />
		<div id="content">
			{$pm_notice}
			{$bannedwarning}
			{$bbclosedwarning}
			{$unreadreports}
			<navigation>
			<br />


By adding more templates and linking to them then you can have a list across your header like mine.

I use the global templates plugin for this (I think you can do it with php in templates and template conditionals but I can't work that out). The global templates plugin does work with 1.6. Alternatively you can just put the code in from the first codeblock I posted where it says {$site_links} in the second codeblock.

I was typing - sadly, RateU closed the forum where his neat tutorial for this was posted - maybe he has a copy of it. He explains better than me.

Hmm, I should add that you can have multiple drop downs on the pages etc but each one must have its own name - so once you have used forumlink you cant use that one again. Call the next one helplink (use helplink in all three instances), then memberlink etc etc.



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 08-09-2010 01:43 PM by leefish.)
08-09-2010 09:05 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
menu dropdown - Shemo - 08-08-2010, 10:18 AM
RE: menu dropdown - leefish - 08-09-2010, 12:49 AM
RE: menu dropdown - Shemo - 08-09-2010, 05:15 AM
RE: menu dropdown - leefish - 08-09-2010, 07:17 AM
RE: menu dropdown - Shemo - 08-09-2010, 08:54 AM
RE: menu dropdown - leefish - 08-09-2010 09:05 AM
RE: menu dropdown - Shemo - 08-09-2010, 09:13 AM
RE: menu dropdown - Shemo - 08-09-2010, 02:34 PM
RE: menu dropdown - Imran - 08-09-2010, 05:11 PM
RE: menu dropdown - leefish - 08-09-2010, 11:15 PM
RE: menu dropdown - Shemo - 08-10-2010, 04:42 AM
RE: menu dropdown - leefish - 08-10-2010, 07:07 AM
RE: menu dropdown - leefish - 08-10-2010, 09:39 AM
RE: menu dropdown - Shemo - 08-10-2010, 01:25 PM

 Standard Tools
Forum Jump: