Customizing SMF > Graphics and Templates

Adding the standard drop-down menu to a custom theme

(1/2) > >>

Myrrdin:
Hi there guys/gals! I seem to have gotten myself into a bit of a pickle. I am using the "As 2.0" theme by Fussilet and by the looks of it, it does not feature drop-down menus for the main tabs (such as administration)
.

SMF Version: 2.0.2

Now, if I check other themes; they are quite different. Subs.php is supposed to be used by the forum to create this, but the problem is that it has a very custom menu which uses javascript etc, so it has its own sections for the menus.

This is what it currently looks like:


--- Code: --- // Start of the tab section.
echo '
<ul>';

// Show the default [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="' , $current_action == 'home' ? 'current' : '' , '"><a href="', $scripturl, '">' , $txt['home'] , '</a></li>';

// Show the default [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="' , $current_action == 'forum' ? 'current' : '' , '"><a href="', $scripturl, '?action=forum">' , $txt['forum'] , '</a></li>';

// Show the [help] button.
echo ($current_action=='help' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="' , $current_action == 'help' ? 'current' : '' , '"><a href="', $scripturl, '?action=help">' , $txt['help'] , '</a></li>';


// How about the [search] button?
if ($context['allow_search'])
echo ($current_action=='search' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="' , $current_action == 'search' ? 'current' : '' , '"><a href="', $scripturl, '?action=search">' , $txt['search'] , '</a></li>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action=='admin' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="' , $current_action == 'admin' ? 'current' : '' , '"><a href="', $scripturl, '?action=admin">' , $txt['admin'] , '</a></li>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action=='admin2' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="' , $current_action == 'admin2' ? 'current' : '' , '"><a href="', $scripturl, '?action=moderate">' , $txt['moderate'] , '</a></li>';

// Show the default [media] button.
echo ($current_action=='media' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="' , $current_action == 'media' ? 'current' : '' , '"><a href="', $scripturl, '?action=media">' , $txt['media'] , '</a></li>';

--- End code ---

My question is: How would I add drop-down menus for this theme?

Thanks in advance!

Yoshi:
If your CSS supports it, you can.

1.1.x themes do not feature the CSS for this, so you can't unless you hack it in.

I have no idea of how this theme works or how dropdowns work, though.

Myrrdin:

--- Quote from: Yoshi2889 on April 30, 2012, 04:14:25 PM ---If your CSS supports it, you can.

1.1.x themes do not feature the CSS for this, so you can't unless you hack it in.

I have no idea of how this theme works or how dropdowns work, though.

--- End quote ---

Ah sorry, I forgot to mention that I am using SMF 2.0.2. I have added that information to the OP.

The only things related to drop-downs in the theme's index.css is related to the admin menu drop-downs when you are in the administration enter.

From what I could see, Subs.php is where the main-menu drop-downs were created and used. But since this theme uses its own main menu files with different code, it is hard for me to get it all set up.

Thank you for your input!

Antechinus:
I'd throw the existing menu away and put the default one back in, then style it to suit.

Myrrdin:

--- Quote from: Antechinus on April 30, 2012, 06:07:06 PM ---I'd throw the existing menu away and put the default one back in, then style it to suit.

--- End quote ---
Although I do see this as an option, i'd like to explore my possibilities further before throwing away such an awesome menu.
Any other ideas?

Navigation

[0] Message Index

[#] Next page

Go to full version