Customizing SMF > Graphics and Templates

Centering the logo within the header.

<< < (2/3) > >>

K@:
No sweat!

Ta for the edits to the pix, man!

vet_ca:
Well I tried your suggestion C@ and crashed the board.  Thankfully had an untouched version of index.template.php so popped that on the server and it good to go again :)  I c&p'd your code snipped (changed the url and image to ours) and put it directly under the <body> tag.  Here's what I see when I inspect the element (logo) in FF 10.0:

 <div id="wrapper">
 <div id="header">
  <div id="top_section">
  <h1 class="forumtitle">
    <div style = "text-align: center;"> <img src="hxxp:uber_____.org/Themes/uber____2.png [nonactive]" usemap="#Banner" alt="" style="border-style:none" /></div>
    </h1>

However, as I said above I cannot find that piece of code anywhere in any of the folders.  Anyway, thank  you for the code, your suggestion and your time.  Cheers.

P.S.  Very sorry I posted in the wrong forum. :-[

K@:
I sold you a dummy, mate.

I used that code with SMF v1.x not v2. :(

Sorry about that!

What I did with v2, is use the usual way, in Admin>Current theme.

To centre it, I made it a transparent gif and made the left side empty, so it looks centred.

vet_ca:
Thank you for your help K@.  I tried what you suggested (additional blank area to the left of the actual logo) a little while back but was unhappy with it because the logo would shift position depending on browser window size.

One of the other admin on our developing forum came up with this fix to index.template.php on line 166 which centers and maintains center position regardless of browser window size.

What is originally there, get rid of all this:

<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>

Replace with:

 <div style = "text-align: center;"> <img src="hxxp:uberXXXXX.org/Themes/uberXXXX2.png [nonactive]" usemap="#Banner" alt="" style="border-style:none" /></div>

Make sure to remove everything from <h1 class="forumtitle"> to </h1> otherwise it won't work.

Just replace the url and logo graphic file name with your own.  Hopefully you'll find this change useful for your forum also.

Cheers,
vet_ca

K@:
I'll sure give it a go!

Ta, man!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version