Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Help with layout - Navbar submenus not working.

Aloittaja Lui++, toukokuu 24, 2011, 01:52:27 IP

« edellinen - seuraava »

Lui++

Hello there, my names Luis.

I'm having an issue with a template that I am using for my forum.
The Navigation Bar sub menus aren't working in this theme.
Not really sure if its a php template issue, css issue or if I'm just dumb.

I'm running SMF 2.0 RC5 here,
(it says I'm not allowed to post links so if you need to see what I mean pm me I guess)
Normally "Quick Links, Admin, Moderation, Profile, Calendar, Messages, Members" have submenus that drop down. And work normally in any other template, but in this template they only link to their respective areas, no drop downs at all.

This is where I have the drop menu codes in the Subs.php file.


// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
{
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'chat' => array(
'title' => $txt['Chat'],
'href' => 'irc://irc.synirc.net/pokeforum',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
),
'quicklink' => array(
'title' => $txt['Quick Links'],
'show' => true,
'sub_buttons' => array(
'acdb' => array(
'title' => $txt['AC Database'],
'href' => 'http://db.artisancave.com "target="blank"',
'show' => !$user_info['is_guest'],
),
'news' => array(
'title' => $txt['News & Updates'],
'href' => 'http://artisancave.com/index.php?board=2.0 "target="blank"',
'show' => true,
),
'welcome' => array(
'title' => $txt['Welcome/Farewell'],
'href' => 'http://artisancave.com/index.php?board=11.0 "target="blank"',
'show' => true,
),
'faq' => array(
'title' => $txt['Help & FaQ'],
'href' => 'http://artisancave.com/index.php?board=3.0 "target="blank"',
'show' => true,
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
),
),
),
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),
'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
'errorlog' => array(
'title' => $txt['errlog'],
'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc',
'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
'is_last' => true,
),
),
),
'moderate' => array(
'title' => $txt['moderate'],
'href' => $scripturl . '?action=moderate',
'show' => $context['allow_moderation_center'],
'sub_buttons' => array(
'modlog' => array(
'title' => $txt['modlog_view'],
'href' => $scripturl . '?action=moderate;area=modlog',
'show' => !empty($modSettings['modlog_enabled']) && !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
),
'poststopics' => array(
'title' => $txt['mc_unapproved_poststopics'],
'href' => $scripturl . '?action=moderate;area=postmod;sa=posts',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'attachments' => array(
'title' => $txt['mc_unapproved_attachments'],
'href' => $scripturl . '?action=moderate;area=attachmod;sa=attachments',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'reports' => array(
'title' => $txt['mc_reported_posts'],
'href' => $scripturl . '?action=moderate;area=reports',
'show' => !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
'is_last' => true,
),
),
),
'profile' => array(
'title' => $txt['profile'],
'href' => $scripturl . '?action=profile',
'show' => $context['allow_edit_profile'],
'sub_buttons' => array(
'summary' => array(
'title' => $txt['summary'],
'href' => $scripturl . '?action=profile',
'show' => true,
),
'account' => array(
'title' => $txt['account'],
'href' => $scripturl . '?action=profile;area=account',
'show' => allowedTo(array('profile_identity_any', 'profile_identity_own', 'manage_membergroups')),
),
'profile' => array(
'title' => $txt['forumprofile'],
'href' => $scripturl . '?action=profile;area=forumprofile',
'show' => allowedTo(array('profile_extra_any', 'profile_extra_own')),
'is_last' => true,
),
),
),
'pm' => array(
'title' => $txt['pm_short'],
'href' => $scripturl . '?action=pm',
'show' => $context['allow_pm'],
'sub_buttons' => array(
'pm_read' => array(
'title' => $txt['pm_menu_read'],
'href' => $scripturl . '?action=pm',
'show' => allowedTo('pm_read'),
),
'pm_send' => array(
'title' => $txt['pm_menu_send'],
'href' => $scripturl . '?action=pm;sa=send',
'show' => allowedTo('pm_send'),
'is_last' => true,
),
),
),
'calendar' => array(
'title' => $txt['calendar'],
'href' => $scripturl . '?action=calendar',
'show' => $context['allow_calendar'],
'sub_buttons' => array(
'view' => array(
'title' => $txt['calendar_menu'],
'href' => $scripturl . '?action=calendar',
'show' => allowedTo('calendar_post'),
),
'post' => array(
'title' => $txt['calendar_post_event'],
'href' => $scripturl . '?action=calendar;sa=post',
'show' => allowedTo('calendar_post'),
'is_last' => true,
),
),
),
'mlist' => array(
'title' => $txt['members_title'],
'href' => $scripturl . '?action=mlist',
'show' => $context['allow_memberlist'],
'sub_buttons' => array(
'mlist_view' => array(
'title' => $txt['mlist_menu_view'],
'href' => $scripturl . '?action=mlist',
'show' => true,
),
'mlist_search' => array(
'title' => $txt['mlist_search'],
'href' => $scripturl . '?action=mlist;sa=search',
'show' => true,
'is_last' => true,
),
),
),
'login' => array(
'title' => $txt['login'],
'href' => $scripturl . '?action=login',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
),
'register' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),
'logout' => array(
'title' => $txt['logout'],
'href' => $scripturl . '?action=logout;%1$s=%2$s',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),
);


And this is the code in the layouts index.template.php that refers to the nav bars


//START TOP MENU
echo'
<div id="topnav2">

<form id="searchformrel" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<fieldset>
<input type="text" value="',$txt['search'],'..." name="search" id="s" onfocus="if (this.value == \'',$txt['search'],'...\') {this.value=\'\';}; return true;" onblur="if (this.value == \'\') {this.value=\'',$txt['search'],'...\';}; return true;" />
<input type="submit" id="searchsubmit" value="',$txt['search'],'" />
</fieldset>
</form>
</div>';

//TEMPLATE MENU
echo'
<div id="topcat">
<ul id="nav">
',template_menu(),'
</ul>
</div>';


Originally on the div tag for topnav2 there was two buttons laid out there saying Home and Forum but they looked gaudy so i took them off. and in the "topcat" tag it has a referally to the original navbar, which is currently not working in this theme.

I'm not really that "php" savvy, so any suggestions as to what I could do to make this template work properly with what I have in my subs file would be greatly appreciated.

Thanks in advance. :D

Advertisement: