Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Custom top menu above the forum

Aloittaja JTVaughn, heinäkuu 16, 2013, 10:25:35 AP

« edellinen - seuraava »

JTVaughn

I've tried searching but the only things I've found are from years ago and for old versions.

I'd like a top menu like the SimplePortal one here: http://www.simpleportal.net/ (Home    Community    Downloads    Documentation    About    Development).

How would I go about adding one? I'm using 2.0.4.

shadow82x

The easiest way would be to use something like this - http://custom.simplemachines.org/mods/index.php?mod=2564 (If your theme is based from Curve)
Colin B
Former Spammer, Customize, & Support Team Member

JTVaughn

Yeah I saw that one, but I'd prefer it positioned actually above the forum's main container thing.

Does that mod still work? And can the menu it creates be moved up?

shadow82x

I mean it will require some custom coding depending on the theme you're using.
Colin B
Former Spammer, Customize, & Support Team Member

JTVaughn

This is the code it adds to the template:


// The code for the menu you installed dont you remember it?
   echo '
<div id="site_menu" class="align_right" style="float: right; margin-top: 9px;">
<ul class="dropmenu" id="site_nav">';

   for ($i=1; $i<6; $i++)
      {
         if (!empty($modSettings['tab_url' . $i]) && !empty($modSettings['tab_title' . $i]))
         {
            echo '
               <li id="button', $i, '">
                  <a class="firstlevel" href="', $modSettings['tab_url' . $i],'"';
if(!empty($modSettings['newpage' . $i]))
echo ' TARGET="_blank"';
echo '>
<span class="firstlevel">', $modSettings['tab_title' . $i], '</span>
                  </a>
               </li>';
         }
      }
   echo'
         </ul>
            </div>



Would that go *above* the board without errors? It's made to go into the header section.

shadow82x

Yes, if you move that code bit it will move the location of the menu. But there is also a lot of css edits you will have to do to get it looking right.
Colin B
Former Spammer, Customize, & Support Team Member

JTVaughn

That's fine, CSS editing is one thing I can do quickly. I'll give it a go, thanks.

Advertisement: