Page 1 of 1

Three and two column with one template

Posted: Wed Feb 08, 2012 7:40 am
by Gregor
Based on the Liquied theme from Matthew James Taylor http://matthewjamestaylor.com/blog/perf ... id-layouts and help from some forum members, I managed to create a Three and Two column lay-out while using just one template. A lot of content was put in GCB.

The trick is done in this part of the template (don't know how to colorize inside the code)
<div id="pagewrapper" class="colmask {if $page_alias == "home"}threecol{else}leftmenu{/if}">
The alias of the first page is "home", otherwis it won't work ;)

The template:

Code: Select all

{process_pagedata}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl" xmlns:addthis="">
<head>
   {cms_stylesheet}
   {* This is how all the stylesheets attached to this template are linked to * }
   {if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if *}
   {if $canonical != ''}
      {* detail pagina mobiel http://m.xxx.nl/log/99/munge_string_to_url_title/ *}
      {* canonical =  http://www.xxx.nl/blog/99/munge_string_to_url_title/ *}
      <link rel="canonical" href="{$canonical}" />
   {elseif $page_name == 'lbjaar'}
      {* index pagina mobiel www.m.xxx.nl/blog/ *}
      <link rel="canonical" href="http://www.uisge-beatha.eu/logboek/" />
   {/if}
   {strip} 
   {* 28nov11  use strip to get rid of whitespace -- http://www.i-do-this.com/blog/48/Put-your-CMSMS-Metatags-on-autopilot *}
   {content assign='get_content'}
   {if isset($get_title)}
      <title>{sitename} - {$get_title}</title>
   {else}
      <title>{sitename} - {title}</title>
   {/if}   
   {/strip}
   {* The sitename is changed in Site Admin/Global settings. {title} is the name of each page *}

   {tracewatch}
   {* SEOTools2 *}
   {* autometa *}
   {metadata}
   {* Don't remove this! Metadata is entered in Site Admin/Global settings. *}

   {cms_selflink dir="start" rellink=1}
   {cms_selflink dir="prev" rellink=1}
   {cms_selflink dir="next" rellink=1}
   {* Relational links for interconnections between pages, good for accessibility and Search Engine Optmization *}
   
   {global_content name='UB_head_js'}
   {capture assign="metadescription"}{content block="metadescription" label="META Description" oneline="true"}{/capture}

   {CGFeedMaker action='autodiscovery' feed='logboek'}
   {analitics urchin="UA-3361592-1"}
</head>
</__body>
   <div id="header">
      {global_content name='UB_header'}
   </div> 
  
   {* Start Navigation, stylesheet "Navigation: ShadowMenu - Horizontal" *}
   <h2 class="accessibility">Navigation</h2>
   {menu template="schaduw"}
   <hr class="accessibility" />
   {* End Navigation *}

   {* Start Bar *}
   <div id="bar">
      {global_content name='UB_header_bar'}
   </div>
   {* End Bar *}

   <div id="pagewrapper" class="colmask {if $page_alias == "home"}threecol{else}leftmenu{/if}">
       <div class="colmid">
	    <div class="colleft">
	        <div class="col1">
                    {global_content name='UB_col1_c'}
{* get_template_vars *}

		</div>
		<div class="col2">
		    {* Column 2 start / left side *}
                    {global_content name='UB_col2_l'}
                    {* Column 2 end *}
                    {content block="Tags" wysiwyg="false" oneline="true"}
                    {cms_module module="simpletagging" action="related"}
	        </div>
         	{if $page_alias == "home"}
                    <div class="col3">
		        {* Column 3 start / right side *}
                        {global_content name='UB_col3_r'}
		        {* Column 3 end *}
	             </div>
		{/if}
	    </div>
	</div>
        <span class="util-clearb">&nbsp;</span>
   </div>
   {* Start Footer. Edit the footer in the Global Content Block called "UB_footer" *}
   <div id="foot-wrapper">
       {global_content name='UB_footer'}
   </div>
   {* End Footer *}
   {global_content name='UB_body_js'}
   
<__body>
{capture assign="metapagedescription"}{content block="metapagedescription" label="Page Description" oneline="true"}{/capture}
</__html>
The stylesheet (might need some re-engineering....)
body {
border:0;
width:100%;
background:#fff;
min-width:600px;
font-size:90%;
font:79%/115% "Bookman Old Style";
margin:0;
}

#tagcloud,#tl_tweets, #zeiluitspraken {
width:98%;
padding-bottom:5px;
}

#tagcloud a,#tl_tweets a {
background-image:none;
margin-right:0;
padding-right:0;
}

a {
color:#61363c;
}

/* #main a:hover {
text-decoration: none;
color:#61363c;
background:#b39887;
} */
#main ul li a:hover, p a:hover {
text-decoration: none;
color:#61363c;
background:#b39887;
}

i,em {
font-style:italic;
}

p {
margin-top:0.5em;
margin-bottom:1em;
text-align:left;
padding:0;
}

img {
margin-top:5px;
margin-right:0;
margin-bottom:5px;
}

#main p img {
float:left;
margin-top:10px;
margin-left:10px;
margin-right:10px;
}

/* .addthis_toolbox {
position: relative;
float: left;
font-family: Georgia;
font-size: 14px;
color: #003399;
text-decoration: none;}

.addthis_default_style {
position: relative;
float: left;
margin-top: 12px;
margin-bottom: 24px;
font-family: Georgia;
font-size: 14px;
color: #003399;
text-decoration: none;} */

#ads img {
display:block;
padding-top:10px;
}

.core-float-right {
float:right;
width:28%;
}

#header {
clear:both;
float:left;
width:100%;
height:180px;
background:#61363c url([[root_url]]/uploads/images/cms/Haiku.png) no-repeat right center;
}

#header p,#header h1,#header h2 {
color:#8af753;
margin:0;
padding:0.4em 15px 0;
}

#header ul {
width:100%;
list-style:none;
text-indent:-999em;
display:none;
}

#header ul li {
display:inline;
list-style:none;
margin:0;
padding:0;
}

#header ul li a {
display:block;
float:left;
text-align:center;
background:#eee;
color:#000;
text-decoration:none;
position:relative;
left:15px;
line-height:1.3em;
margin:0 0 0 1px;
padding:3px 10px;
}

#header ul li a:hover {
color:#fff;
background-color:#369;
}

#header ul li a.active,#header ul li a.active:hover {
color:#fff;
background:#000;
font-weight:700;
}

#search {
width:178px;
position:relative;
bottom:15px;
border-style:outset;
}

#search label {
text-indent:-9999em;
display:none;
}

#search input.search-input {
width:143px;
font:bold 0.9em Arial, Helvetica, sans-serif;
background:url(http://ljd.uisge-beatha.eu/uploads/NCle ... search.png) no-repeat;
float:left;
border-style:none;
padding:7px 0 4px 10px;
}

* {
font-weight:inherit;
font-style:inherit;
font-family:inherit;
}

div#header_banner {
display:inline-block;
height:180px;
position:absolute;
float:left;
top:-5px;
}

div#search input.search-button {
width:37px;
height:28px;
text-indent:-9999em;
float:right;
cursor:pointer;
font-size:0;
line-height:0;
background:transparent url(http://ljd.uisge-beatha.eu/uploads/NCle ... search.png) no-repeat;
border-style:none;
margin:0;
}

.accessibility {
position:absolute;
top:-999em;
left:-999em;
}

#bar {
height:20px;
font:10px "Lucida Grande", Lucida, Verdana, sans-serif;
width:98%;
display:inline-block;
margin-top:5px;
margin-bottom:5px;
background-color:#fffeff;
padding-left:11px;
}

.breadcrumbs {
width:40%;
display:inline-block;
}

.icons {
text-decoration:none;
margin-top:0;
margin-bottom:0;
width:190px;
float:right;
padding-right:10px;
}

.icons img {
text-decoration:none;
width:20px;
height:20px;
float:right;
margin:0 0 0 7px;
}

a.twitter-share-button {
float:left;
}

.col30 {float : left;width : 20%;}

.col30 textarea {width : 300px;height : 100px;}

.col70 {float: left; margin-left: 30px; width: 50%;}

.clearfix:after {
content : ".";
display : block;
height : 0;
clear : both;
visibility : hidden;
}
* html .clearfix {
height : 1%;
}
* html > body .clearfix {
display : inline-block;
width : 100%;
}

#layoutdims {
clear:both;
background:#e5d6cc;
border-top:4px solid #000;
text-align:right;
margin:0;
padding:6px 15px !important;
}

.colmask {
position:relative;
clear:both;
float:left;
width:100%;
overflow:hidden;
}

.colright,.colmid,.colleft {
float:left;
width:100%;
position:relative;
}

.col1,.col2,.col3 {
float:left;
position:relative;
overflow:hidden;
padding:0 0 1em;
}

.threecol {
background:#e5d6cc;
}

.threecol .colmid {
right:25%;
background:#fff;
}

.threecol .colleft {
right:50%;
background:#e5d6cc;
}

.threecol .col1 {
width:46%;
left:102%;
}

.threecol .col2 {
width:21%;
left:31%;
}

.threecol .col3 {
width:22%;
left:85%;
}

.leftmenu {
background:#fff;
}

.leftmenu .colleft {
right:75%;
background:#f4f4f4;
}

.leftmenu .col1 {
width:71%;
left:102%;
overflow:scroll;
overflow-y:scroll;
overflow-x:hidden;
height: 550px;
}

.leftmenu .col2 {
width:21%;
left:6%;
}

#zeiluitspraken {
height:185px;
}

#zeiluitspraken a:link {
text-decoration: underline;
}

#zeiluitspraken ul.slider {
height:auto;
display:block;
margin:0;
}

#zeiluitspraken ul.slider li {
width:180px;
height:auto;
list-style-type:none;
margin-top:5px;
color:#61363c;
}

#zeiluitspraken ul.slider li em {
font-size:12px;
}

#print {
width:20px;
height:20px;
}

.tweetwhen {
font-size:10px;
}

a.external, p a {
padding: 0 11px 0 0;
background: url(http://ljd.uisge-beatha.eu/uploads/NCle ... ternal.gif) no-repeat 100% -100px;
}

a.external {
background: url(http://ljd.uisge-beatha.eu/uploads/NCle ... ternal.gif) no-repeat 100% -100px;
}
a.external span {
position:absolute;
left:-5000px;
width:4000px;
}

.main-main {
width:auto;
border-right:1px solid #e2e2e2;
border-left:1px solid #e2e2e2;
background:#f0f0f0;
padding:0 20px 20px;
}

.left49,.right49 {
font-size:0.85em;
font-weight:700;
margin:7px 5px 5px 0;
}

.left49 span {
display:block;
padding-top:0;
margin-bottom:0;
}

.right49 {
width:44px;
background:url(http://ljd.uisge-beatha.eu/uploads/NCleanBlue/bull.png) no-repeat 0 4px;
float:right;
}

.right49 a,.right49 a:visited {
display:block;
height:15px;
background:url(http://ljd.uisge-beatha.eu/uploads/NCleanBlue/bull.png) no-repeat left top;
color:#000;
clear:none;
padding:7px 4px;
}

#main h3,#main h4,#main h5,#main h6 {
font-size:1.4em;
color:#301e12;
}

#main h4 {
margin-bottom:10px;
margin-top:0;
padding-top:5px;
font-size:18px;
}

#main h5 {
margin-bottom:10px;
margin-top:0;
font-size:16px;
}

div#main ul,div#main ol,div#main dl,#footer ul,#footer ol {
line-height:1em;
margin:0 0 1.5em;
}

div#main ul,#footer ul {
list-style:circle;
}

div#main ul a:hover {
color:#01208b;
}

div#main ul li,div#main ol li,#footer ul li,#footer ol li {
margin-left:20px;
padding:2px 2px 2px 5px;
}
#main ul li a {
background: url(http://ljd.uisge-beatha.eu/uploads/NCle ... ternal.gif) no-repeat 100% -100px;
padding-right: 12px;
line-height: 15px;
}

#main ul li.thumb a {
background-image: none;
}

div#main dl dt {
font-weight:700;
margin:0 0 0 1em;
}

div#main dl dd {
margin:0 0 1em 1em;
}

div#main dl {
margin-bottom:2em;
padding-bottom:1em;
border-bottom:1px solid silver;
}

.rotate {
margin-bottom:10px;
width:150px;
margin-right:10px;
float:left;
}

#tagcloud h2,#tweets h2,#zeiluitspraken h2 {
color:#61363c;
margin-bottom:7px;
text-align:center;
}

a.cloud_0 {
line-height:110%;
font-size:0.8em;
}

a.cloud_1 {
font-size:0.9em;
line-height:110%;
}

a.cloud_2 {
font-size:1em;
line-height:110%;
margin-right:5px;
}

a.cloud_3 {
font-size:1.1em;
line-height:110%;
margin-right:5px;
}

a.cloud_4 {
font-size:1.2em;
line-height:110%;
margin-right:5px;
}

a.cloud_5 {
font-size:1.3em;
line-height:110%;
margin-right:5px;
}

a.cloud_6 {
font-size:1.4em;
line-height:110%;
margin-right:5px;
}

a.cloud_7 {
font-size:1.5em;
line-height:110%;
margin-right:5px;
}

a.cloud_8 {
font-size:1.6em;
line-height:110%;
margin-right:5px;
}

a.cloud_9 {
font-size:1.7em;
line-height:110%;
margin-right:5px;
}

a.cloud_10 {
font-size:1.8em;
line-height:110%;
margin-right:5px;
}

#footer-wrapper {
width:auto;
text-align:center;
margin-right:0;
margin-left:0;
font-size:12px;
}

div#footer {
float:left;
color:#ff9134;
width:100%;
background-color:#61363c;
font-size:0.8em;
}

#footer p {
color:#d5d5d5;
font-size:11px;
}

#footer .block {
width:25%;
float:left;
}

#footer .cms a {
background-image:none;
padding-right:0;
margin-right:0;
}

#footer .cms {
color:#ff9134;
width:45%;
float:right;
padding-top:5%;
}

#footer ul {
text-align:left;
color:silver;
list-style-type:circle;
width:35%;
}

#footer ul ul {
margin-left:0;
}

#footer ul li a {
color:#d5d5d5;
display:block;
font-weight:400;
margin-bottom:0.5em;
text-decoration:none;
}

#footer a {
color:#d5d5d5;
text-decoration:none;
}

.w3c {
float:right;
margin-top:67px;
}

#logboek,#nieuwtjes {
background:#e5d6cc;
width:100%;
padding-bottom:1px;
}

div#logboek h2 a,#nieuwtjes h2 a {
font-size:108%;
line-height:2em;
background:#61363c;
text-align:left;
color:#fffeff;
}

div#logboek h2 a:hover,#nieuwtjes h2 a:hover {
color:#008d2b;
}

.NieuwPages {
margin-bottom:7px;
}

.CGBlogCategoryLabel {
width:62px;
display:inline-block;
margin-right:5px;
font-style:italic;
position:static;
}
Hope this helps or brings one to new ideas.

Any comments are welcome!

Gregor