Article Series: 3 Column Templates Step by Step Guides
Here are the steps to convert a Blogger default 2 column Rounders template in to a 3 column template with sidebars on left and right hand sides of the main post area.
(If you really want to understand what's happening here, read the article series Three Column Templates Explained.)
(Note: Ensure that you backup your template before you start making any changes, to be able to revert back in case anything goes wrong.)
1) Add a new CSS id selector for the 2nd sidebar wrapper.
- Go to Layout -> Edit HTML
- Locate the #sidebar-wrap selector (Do a Find using your browser)
- Copy that full section and paste below the existing sidebar section (it doesn't have to below) and rename it to #left-sidebar-wrap
- Change the float: $endSide to float:$startSide of the #left-sidebar-wrap selector (See the code snippet below)
#sidebar-wrap {
width:240px;
float:$endSide;
margin:15px 0 0;
font-size:97%;
line-height:1.5em;
word-wrap: break-word; /* fix for long ... IE */
overflow: hidden; /* fix for long non-text ... float */
}
#left-sidebar-wrap {
width:240px;
float:$startSide;
margin:15px 0 0;
font-size:97%;
line-height:1.5em;
word-wrap: break-word; /* fix for long ... IE */
overflow: hidden; /* fix for long non-text ... float */
}
width:240px;
float:$endSide;
margin:15px 0 0;
font-size:97%;
line-height:1.5em;
word-wrap: break-word; /* fix for long ... IE */
overflow: hidden; /* fix for long non-text ... float */
}
#left-sidebar-wrap {
width:240px;
float:$startSide;
margin:15px 0 0;
font-size:97%;
line-height:1.5em;
word-wrap: break-word; /* fix for long ... IE */
overflow: hidden; /* fix for long non-text ... float */
}
2) Introduce a new div element, as a child of the outer-wrapper, to be the placeholder for the 2nd sidebar
- Locate the <div id='main-wrap1'> element.
- Copy the code shown in red, above that section (this has to be above)
<div id='crosscol-wrapper' style='text-align:center'>
<b:section class='crosscol' id='crosscol' showaddelement='no'/>
</div>
<div id='left-sidebar-wrap'>
<div id='sidebartop-wrap'><div id='sidebartop-wrap2'>
<b:section class='sidebar' id='left-sidebartop'>
</b:section>
</div></div>
<div id='sidebarbottom-wrap1'><div id='sidebarbottom-wrap2'>
<b:section class='sidebar' id='left-sidebar' preferred='yes'/>
</div></div>
</div>
<div id='main-wrap1'><div id='main-wrap2'>
<b:section class='main' id='main' showaddelement='no'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
</div></div>
3) Expand the width of the parent wrappers to accommodate the new sidebar
- Locate the CSS section called #outer-wrapper
- Change its width property to 980 pixels
#outer-wrapper {
width: 980px;
...
}
width: 980px;
...
}
4) Do necessary adjustments to margins, padding etc
- Locate the #left-sidebar-wrap section
- Insert a right margin of 7 pixels.
#left-sidebar-wrap {
width:240px;
float:$startSide;
margin:15px 7px 0 0;
...
}
width:240px;
float:$startSide;
margin:15px 7px 0 0;
...
}
5) Modify and expand the background images as necessary.
- Add a template variable to define the image host location as explained here. (This step will open up in a separate window. Return to the next bullet point after that)
- Locate the following CSS selectors.
- Replace the URLs of the images to the ones shown in red below.
#header-wrapper {
background:url("$imageHost/rounders_corners_cap_top_w.gif") no-repeat $startSide top;
...
}
#header {
background:url("$imageHost/rounders_corners_cap_bot_w.gif") no-repeat $startSide bottom;
...
}
#footer-wrap2 {
background:$titleBgColor url("$imageHost/rounders_corners_cap_top_w.gif") no-repeat $startSide top;
color:$titleTextColor;
}
#footer {
background:url("$imageHost/rounders_corners_cap_bot_w.gif") no-repeat $startSide bottom;
padding:8px 15px;
}
background:url("$imageHost/rounders_corners_cap_top_w.gif") no-repeat $startSide top;
...
}
#header {
background:url("$imageHost/rounders_corners_cap_bot_w.gif") no-repeat $startSide bottom;
...
}
#footer-wrap2 {
background:$titleBgColor url("$imageHost/rounders_corners_cap_top_w.gif") no-repeat $startSide top;
color:$titleTextColor;
}
#footer {
background:url("$imageHost/rounders_corners_cap_bot_w.gif") no-repeat $startSide bottom;
padding:8px 15px;
}
Note: Step 6 is only needed if your Layout Editor does not show the newly added sidebar. There was an issue where Firefox browser didn't show a 3 column template fully in the edit mode. But Blogger reports that the issue has been fixed now.
6) Modify the CSS rules for the wire frame layouts editor.
- Locate the section that starts with "/** Page structure tweaks for layout editor wireframe */"
- Replace that entire section with the following code.
/** Page structure tweaks for layout editor wireframe */
body#layout #header-wrapper,
body#layout #outer-wrapper,
body#layout #footer-wrap1 {
width:830px;
}
body#layout #main-wrap1 {
width: 485px;
margin-right:10px;
}
body#layout #sidebar-wrap,
body#layout #left-sidebar-wrap {
width:150px;
}
]]></b:skin>
body#layout #header-wrapper,
body#layout #outer-wrapper,
body#layout #footer-wrap1 {
width:830px;
}
body#layout #main-wrap1 {
width: 485px;
margin-right:10px;
}
body#layout #sidebar-wrap,
body#layout #left-sidebar-wrap {
width:150px;
}
]]></b:skin>
Save the template. Switch to Page Elements view and enjoy your 3 column template! (The new sidebar might not be visible until you add some gadgets to it)
Note: You are free to use the images provided by me. But if you change your template according to this tutorial and use those images, please add the following code shown in red, right to the end of your template, in the place shown. It will simply link to this blog.
</div>
<a href="http://www.bloggerguide.lk/2008/02/3-columns-step-by-step-guides.html">Three Column Modification</a> courtesy of <a href="http://www.bloggerguide.lk">The Blogger Guide</a>
</body>
</html>
<a href="http://www.bloggerguide.lk/2008/02/3-columns-step-by-step-guides.html">Three Column Modification</a> courtesy of <a href="http://www.bloggerguide.lk">The Blogger Guide</a>
</body>
</html>