MyBB Community Forums

Full Version: Changing HTML references for #container
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey all,
First time appreciator of this fantastic forum here. Here's the problem -

I want to use the #container ID only for the main body of the forum. I want to create separate ID for the header and the footer so they don't show up as part of the body. Where can I edit the HTML code itself so <div> for header and footer point to a different ID than #container ID?

Below is a screenshot of what I want to achieve with the HTML code, I'm just not able to find the code anywhere to edit. I have edited the CSS and I know it works and I have edited footer.php so it points to CSS properly, but #container in the HTML overlaps the header and the footer.

Hopefully I'm explaining this properly.

Thanks!
myBB uses templates system AND the code in templates can be adjusted to suit own choices.
its better to not touch the core php files unless it is a must. template system can be seen at
Admin Panel --> Templates --> your current set of templates set

in general, each theme should have a separate templates set

the code you were trying to find is at header template (under header templates) & footer template

see also : Admin CP Templates
Thanks for the response. The issue is that the container file is overlapping with the header and the footer (see below). I assume it's because all the <div> codes are under <div id="container"> so it "spans" the container style to the header and the footer when I only want it for the content.

I'm looking at the Admin CP templates.

Edit: I have gone through the header and footer templates and corrected those. They are working fine individually, but get overlapped by the container ID used in the main body.
just an idea :
you can remove class container for the div AND put your own class (eg. newcontainer)
AND add div tags with other class / id wherever required with the CSS added to global.css
(2011-08-07, 05:26 AM)ranjani Wrote: [ -> ]just an idea :
you can remove class container for the div AND put your own class (eg. newcontainer)
AND add div tags with other class / id wherever required with the CSS added to global.css

Are you suggesting to rename container class in global.css? Then where would I go to edit the div tags to point to the newcontainer class? I can't even find any templates which contain div tags pointing to the container class itself other than the header and the footer which I have changed.

All I want to do is move the div tags for header and footer out of the container class and I can't find any other templates in the list that use the container class anywhere.

Sorry, bit of a newbie question but I'm pretty confused.
^ sorry to make it complicated !! you just want to move the header part with logo from container .
for that you can simply find the header div start & end AND move that to top. please paste your
header template in code tags here if required
(2011-08-07, 06:18 AM)ranjani Wrote: [ -> ]^ sorry to make it complicated !! you just want to move the header part with logo from container .
for that you can simply find the header div start & end AND move that to top. please paste your
header template in code tags here if required

Here is my footer template. Can you please show me with this, and I'll repeat it with the header?

<div id="container_footer"> this was pointing to container ID before and I changed it.

<br />
  <div id="container_footer">
    <div class="bottommenu">
      <div class="float_right">{$lang_select}
      </div>
      <div>
      <span class="smalltext"><a href="{$mybb->settings['contactlink']}">{$lang->bottomlinks_contactus}</a> | <a href="{$mybb->settings['homeurl']}">{$mybb->settings['homename']}</a> | <a href="#top">{$lang->bottomlinks_returntop}</a> | <a href="#content">{$lang->bottomlinks_returncontent}</a> | <a href="<archive_url>">{$lang->bottomlinks_litemode}</a> | <a href="{$mybb->settings['bburl']}/misc.php?action=syndication">{$lang->bottomlinks_syndication}</a>
</span>
      </div>
    </div>
<hr class="hidden" />
    <div id="copyright">
      <div id="debug"><debugstuff>
      </div>
	<!-- MyBB is free software developed and maintained by a volunteer community. 
		It would be much appreciated by the MyBB Group if you left the full copyright and "powered by" notice intact, 
					 to show your support for MyBB.  If you choose to remove or modify the copyright below, 
					 you may be refused support on the MyBB Community Forums.
					 
					 This is free software, support us and we'll support you. -->
{$lang->powered_by} <a href="http://mybb.com/" target="_blank">MyBB{$mybbversion}</a>, &copy; 2002-{$copy_year} <a href="http://mybb.com/" target="_blank">MyBB Group</a>.<br />
{$lang->qthemes_theme_by} <a href="http://quacktacular.net" target="_blank">Quacktacular Media</a>.<br />
				<!-- End powered by -->
				<br />
<br class="clear" />
<!-- The following piece of code allows MyBB to run scheduled tasks. DO NOT REMOVE -->{$task_image}<!-- End task image code -->
{$auto_dst_detection}
    </div>
  </div>
there appears to be a mistake with a closing div tag . I understand that you have
added <div id="container_footer"> at top of footer & closed it at the bottom
unsure that its correct as I find that a div closing is missing at the bottom

if your forum is online then you can submit it to html validator to check it

there is no such confusion for the header part as the logo part can be easily separated

Lets wait for an expert AND I may be excused for wasting your time Sad ..
I checked with the validator and there are 9 errors in total so I'll probably have to spend some time on that.

Also, I managed to separate the header. You were right, it was more straightforward, however, I don't know how to separate the footer as the screenshot shows above. If someone can help with this, I'd be very very grateful.

Thanks,
^ if you put a </div> at the top of footer template then there the container div should end
AND the new class for the custom footer div should apply ...
Pages: 1 2