Customizing SMF > SMF Coding Discussion

Navigation links error

(1/1)

Egoista:
Okay so I will try to explain to the best of my ability.

The "sub buttons" in my forum are acting as if they are normal buttons instead of being listed in a drop down menu. I edited a lot of the css and template that I got it from to make it look like the rest of the site.

Please help me as I have no idea what to do.

I already looked at Subs.php and the buttons are intact.

Thank you in advance for any help that you can give me.

If you need to see the actual site, it is at verleta.net/community, but you won't see anything wrong if you're a guest. If you're a member, or in my case an admin which has a lot more sub buttons, you'll see the probkem.

Egoista:
Could it be something having to do with the CSS?

emanuele:
Hello Egoista,

it has for sure something to do with the css since the dropdown is done with css and for that reason without see it, it's difficult to figure out...(not that I'd be able to give you a solution even seeing the issue...lol (don't tell anyone but I'm a mess with css :P)).

Egoista:
Haha alright, well thanks for the response. Ill try to redo everything with the theme I based it off of.

Egoista:
I'm still having quite a bit of trouble. I know that it's here:


--- Code: ---// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<ul id="topnav">';

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', '" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '><span>', $button['title'], '</span></a>';

if (!empty($button['sub_buttons']))
{
echo '
<ul>';

foreach ($button['sub_buttons'] as $childbutton)
{
echo '
<li>
<a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>', $childbutton['title'], !empty($childbutton['sub_buttons']) ? '...' : '', '</a>';

// 3rd level menus :)
if (!empty($childbutton['sub_buttons']))
{
echo '
<ul>';

foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>', $grandchildbutton['title'], '</a>
</li>';

echo '
</ul>';
}

echo '
</li>';
}
echo '
</ul>';
}
echo '
</li>';
}

echo '
</ul>';
}

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $strip_options = array())
{
global $settings, $context, $txt, $scripturl;

if (!is_array($strip_options))
$strip_options = array();

// List the buttons in reverse order for RTL languages.
if ($context['right_to_left'])
$button_strip = array_reverse($button_strip, true);

// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '
<li><a' . (isset($value['id']) ? ' id="button_strip_' . $value['id'] . '"' : '') . ' class="button_strip_' . $key . (isset($value['active']) ? ' active' : '') . '" href="' . $value['url'] . '"' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '><span>' . $txt[$value['text']] . '</span></a></li>';
}

// No buttons? No button strip either.
if (empty($buttons))
return;

// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>', '<span class="last">', $buttons[count($buttons) - 1]);

echo '
<div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"': ''), '>
<ul>',
implode('', $buttons), '
</ul>
</div>';
}

?>
--- End code ---

But I dont see the problem.

Here's some of the css:

#topnav

--- Code: ---#topnav {
float: left;
font-size: 11px;
margin: 0;
padding: 0;
}
#topnav ul {
margin: 0;
padding: 0;
z-index: 1000;
}
#topnav li {
float: left;
margin: 0;
padding: 0;
position: relative;
list-style: none;
}
#topnav li a {
display: block;
float: left;
padding: 0 15px;
line-height: 31px;
color: #fff;
background: url(../images/custom/toolbar-div.png) 100% 0 no-repeat;
}
#topnav li a.active {
font-weight: bold;
}
#topnav li a:hover {
color: #444;
text-decoration: none;
}
#topnav li li {
width: 200px;
height: auto;
padding: 0;
margin: 0;
}
#topnav li li a, #topnav li:hover li a {
background: none;
display: block;
line-height: 26px;
padding: 0 16px;
width: 168px;
float: none;
font-weight: normal;
}
#topnav li ul {
background: #646c77;
border: 1px solid #555;
position: absolute;
width: 200px;
left: -999em;
padding: 4px 0;
margin-left: -1px;
}
#topnav li:hover ul {
top: 30px;
left: 0;
}
#topnav li:hover li ul, #topnav li li:hover li ul {
top: -999em;
}
#topnav li li:hover ul, #topnav li li li:hover ul {
left: 190px;
top: 0;
}
--- End code ---

Navigation

[0] Message Index

Go to full version