Customizing SMF > Graphics and Templates

Adding the standard drop-down menu to a custom theme

<< < (2/2)

Antechinus:
What's awesome about it?

ETA: NVM. One of those silly wobbly blob things. You'll have to construct your own markup and css for the drop menus by using the default as a guide. The js for the wobbly blob might cause you some amusement too. Have fun.

Myrrdin:

--- Quote from: Antechinus on May 01, 2012, 02:46:16 AM ---What's awesome about it?

ETA: NVM. One of those silly wobbly blob things. You'll have to construct your own markup and css for the drop menus by using the default as a guide. The js for the wobbly blob might cause you some amusement too. Have fun.

--- End quote ---
Hehe, yeah; thanks.

Question though, what would the syntax even look like for the type of buttons this theme is using?
I have tried directly copying the drop-down stuff to the theme, but it crashes when I do. I believe the drop-down code needs to be modified to suit the code I listed in the OP.
Any ideas on how to do that?

All I need is something to base my work on, I can do the rest myself.

I found this little thread that might help me a bit. (you were the one who assisted the user) :)
hxxp:www.dzinerstudio.com/index.php?PHPSESSID=e16f897155b6ca67ae83b2655e4f4dd3&topic=2586.0 [nonactive]

I am currently looking to modify this:

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



// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'admin2', 'calendar', 'profile', 'forum', 'media', 'mlist', 'register', 'login', 'logout', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}
--- End code ---

To incorporate this:

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

echo '
<div class="tabs">
<ul>';
foreach ($context['menu_buttons'] as $act => $button)
{
echo '   <li><a ', $button['active_button'] ? ' class="current"' : '' , ' href="', $button['href'], '">
         <span class="menu-left"></span>
<span class="menu-right">' , $button['title'] , '</span></a>';

          //    Does this button have any subbuttons?
        if(!empty($button['sub_buttons']))
        {
            echo '
                             <div class="sub">
<ul>';
            foreach($button['sub_buttons'] as $sub_button)
                    echo '
                <li><a href="', $sub_button['href'], '">' , $sub_button['title'] , '</a></li>';
            echo '
                                 </ul>
</div>';      
         }

echo' </li>';

}

echo '
</ul>
</div>';

}
--- End code ---

Any ideas?

Navigation

[0] Message Index

[*] Previous page

Go to full version