Customizing SMF > Graphics and Templates

Centering Menu Bar.

(1/2) > >>

Devicon:
I have tried a few modifications, they didn't work. I'm looking to center my menu bar.

I'm using the theme Estalia.

Here is what i believe to by my menu code.


--- Code: ---function template_body_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   echo '
   <div id="body-top">
      <div id="top-banner">     
      </div>
   </div>
   
      ',template_menu(),'
   <div id="mainbody">
      <div class="clr"/></div>
      <div class="wrapper">';
         
     
   theme_linktree2(false,'white');
   
   //SMFPacks Shoutbox -->
   if (function_exists('template_shoutbox')) template_shoutbox('main');
   // <-- SMFPacks Shoutbox
--- End code ---

Runic:

--- Code: ---template_menu()
--- End code ---


Look for this again at bottom of the index.template.php and post the code please, if there is any css classes or id's in it please also post them.
Thanks

Devicon:

--- Quote from: Poύνικ on August 16, 2012, 10:41:59 AM ---
--- Code: ---template_menu()
--- End code ---


Look for this again at bottom of the index.template.php and post the code please, if there is any css classes or id's in it please also post them.
Thanks

--- End quote ---

That was in the code i posted.


--- Quote ---
--- Code: ---',template_menu(),'
   <div id="mainbody">
      <div class="clr"/></div>
      <div class="wrapper">';
--- End code ---

--- End quote ---

Krash.:


If anyone can do this in index.css, I'd like to see it.  Can float right or left, and set fixed margins, but cannot center it (margin: auto doesn't work). >:(

Here's a crappy inline hack you can use -

In index.template.php:


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


echo'
<div id="navigation">
<div class="wrapper" align="center">
<div style="display: inline-block;">
<ul>';

foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a href="', $button['href'], '">', $button['title'], '</a></li>';

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


--- End code ---

Yeah, I know it's deprecated, but it werks gud.

Devicon:
Thanks man, it worked great.

Navigation

[0] Message Index

[#] Next page

Go to full version