News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Switching DIV positions in index.template.php

Started by archvillainxx, April 06, 2012, 06:04:06 PM

Previous topic - Next topic

archvillainxx

Hi. I probably should know this by now, but need help figuring out how to move the header above/outside of the wrapper div.
I'm trying to have the header always stay 100% in width while the width for the rest of the forum can be adjusted through Theme Settings.


   echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '
   <div id="header"> ',template_menu(),'</div>';


Thanks.

Antechinus

How much of the header content d you want to move? If you could rough out a screenshot of the desired result, using any form of graphics butchery you like, that would help.

archvillainxx

I wanted to move the entire header div before the wrapper div. Only problem is I'm not too good with ". '">' : '', '" and such.
In plain html I figured it would be something like

<div id="header"></div>
<div id=wrapper">
...


Couldn't really do it with a screen shot so here's the next best thing. Good old paint.

Antechinus

K. Try this index.template.php:

Find: echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '


Repalce: echo '

Find: echo '
<br class="clear" />
</div></div>';


Replace: echo '
<br class="clear" />
</div></div>';
echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : ''

Advertisement: