<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Plastikwrap</title>
	<atom:link href="http://plastikwrap.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://plastikwrap.co.uk</link>
	<description>($happy) ? :D : ):</description>
	<lastBuildDate>Sun, 29 Apr 2012 13:58:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Facebook: our internal MiniTrue</title>
		<link>http://plastikwrap.co.uk/comment/facebook-our-internal-minitrue/</link>
		<comments>http://plastikwrap.co.uk/comment/facebook-our-internal-minitrue/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 13:57:49 +0000</pubDate>
		<dc:creator>laurence</dc:creator>
				<category><![CDATA[comment]]></category>

		<guid isPermaLink="false">http://plastikwrap.co.uk/?p=162</guid>
		<description><![CDATA[This is a submission I made to the recent Guardian article titled Facebook and loneliness: our readers respond. Before I submitted a response by email to the article&#8217;s author, I commented on the article expressing my surprise that the stories that had been published above the line were all positive and that there were none [...]]]></description>
			<content:encoded><![CDATA[<p>This is a submission I made to the recent Guardian article titled <a href="http://www.guardian.co.uk/commentisfree/cifamerica/2012/apr/20/facebook-loneliness-peoples-panel">Facebook and loneliness: our readers respond</a>. Before I submitted a response by email to the article&#8217;s author, <a href="http://www.guardian.co.uk/discussion/comment-permalink/15742657">I commented on the article</a> expressing my surprise that the stories that had been published above the line were all positive and that there were none about the alienating effects of Facebook. The author responded suggesting that I send in my thoughts, which I duly did. They weren&#8217;t published, perhaps because I didn&#8217;t express them well enough, or perhaps for some other reason. At any rate, had they been added to the article, they would have stood out as a very negative interpretation of the impact that Facebook can have.</p>
<p>I had initially interpreted the title of the article (&#8216;Facebook and loneliness&#8217;) as referring to the loneliness caused or accentuated by Facebook, as opposed to the use of Facebook as a tool to reduce feelings of loneliness. While I think it can go some way to achieving the latter, the former is a much more prevalent effect of its (mis)use.</p>
<p>Anyway, here&#8217;s what I submitted:</p>
<blockquote><p>Facebook can be a great communication tool, if that&#8217;s how it is viewed by those who use it. But in many cases, Facebook alienates its users from each other. Unfortunately for many it has become an addiction, where preening our online persona to be a mirage of the person we wish we were has become the priority over the much more difficult task of becoming that person in the real world. Why worry about your development as a human being when you can take a shortcut to perfection on your Facebook profile? The computer creates a buffer which allows us to consider everything we do before we do it, removing the risk inherent in being spontaneous and genuine around people in the physical world. But it is the results of taking that risk that opens us up to forming real connections with our fellow human beings.</p>
<p>&nbsp;</p>
<p>The torrent of poised fakery that we&#8217;re exposed to when browsing Facebook comes at a price. I and many people I&#8217;ve spoken to have felt deeply dejected after a session, as the flow of witty banter, &#8216;fun&#8217; photos in exciting places and lives which seem much more interesting than our own leave us questioning whether we&#8217;re any good at all.</p>
<p>&nbsp;</p>
<p>The irony is that most of us are complicit in the Facebook charade &#8212; we all try to put forward only the best of ourselves on Facebook. The end result is an worryingly pervasive version of the school playground &#8212; but now instead of being judged on what trainers you wear, it&#8217;s your whole life that gets the X Factor treatment. Unfortunately with Facebook the shallowest and most destructive parts of being a teenager are kept alive and well in adulthood.</p></blockquote>
<p>Since the word limit was 250, I&#8217;ve obviously condensed a lot of thoughts into a small space without elaborating on them fully. It&#8217;s important to emphasise the first sentence &#8212; Facebook, if treated as a tool for communication like email or SMS, can be a good thing. But observing the way that people use it in the real world shows that it has managed to latch onto an insecurity that, it appears, a huge number of people have. The need to be included and to feel accepted has become warped out of shape to the point where it&#8217;s not enough to be who we are, rather we need to obsessively filter and amplify the best parts of our lives while ignoring the worst.</p>
<p>We become invested in our own cult of personality, and the person on our profile becomes a perfectly manicured avatar of who we really are. Our Wall is a mechanism through which to publish our personal propaganda, where reality is sanitised and edited so our &#8216;friends&#8217; see only those things that show us in a good light. Just look at the average profile photo and consider what probably went through that person&#8217;s mind when they chose it (and, in many cases, took it with the intention of using it as their profile pic).</p>
<p>Facebook gives that worst of human traits &#8212; narcissism &#8212; the platform it has always wanted. Not only can we tailor our presentation of ourselves, but we also get the delicious prospect of our perfected pseudo-self being beamed directly into the computers and phones of those around us with only minimal effort. Direct manipulation of our PR is just a witty quip or a strategic &#8216;like&#8217; away. The price of all this is more fakery, less genuine self-belief, and ultimately a reduction in the quality of the relationships we have with other people.</p>
]]></content:encoded>
			<wfw:commentRss>http://plastikwrap.co.uk/comment/facebook-our-internal-minitrue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web workflow: tools and frameworks</title>
		<link>http://plastikwrap.co.uk/web-development/workflow-tools-and-frameworks/</link>
		<comments>http://plastikwrap.co.uk/web-development/workflow-tools-and-frameworks/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 11:56:26 +0000</pubDate>
		<dc:creator>laurence</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://plastikwrap.co.uk/?p=155</guid>
		<description><![CDATA[For the last few years &#8216;frameworks&#8217; (or &#8216;boilerplates&#8217;, or &#8216;bootstraps&#8217;) have been all the rage &#8211; they&#8217;re intended to provide developers/designers with prefabricated foundations for their work, removing some of the tedium involved in some of the more robotic aspects of web design and development. I admit that I came a little late to that party [...]]]></description>
			<content:encoded><![CDATA[<p>For the last few years &#8216;frameworks&#8217; (or &#8216;boilerplates&#8217;, or &#8216;bootstraps&#8217;) have been all the rage &#8211; they&#8217;re intended to provide developers/designers with prefabricated foundations for their work, removing some of the tedium involved in some of the more robotic aspects of web design and development. I admit that I came a little late to that party &#8211; it was only in September 2010 that I stumbled across the <a href="http://960.gs">960 Grid System</a> and the full benefits of a CSS framework became clear to me. Prior to that I hand-coded pretty much every site, and many a yard of my hair was lost trying to figure out the idiosyncrasies of the various browsers (not naming any names, but this was of course at a time when version 6 of a certain browser was still very prevalent and still required full or near-full support). It was pretty revelatory to me to have a massive chunk of that work done already.</p>
<p>So by no means am I disparaging the idea of frameworks &#8211; when done right they can be a great example of open source in action and can be genuinely useful. I&#8217;m always cheered by the work that people put into these things to prevent others from having to re-invent the wheel &#8211; the altruism/kudos incentive is a fascinating thing. I have a lot to thank them for, as do my clients, in saved time and cost and, of course, enhanced end results.</p>
<p><strong>Lameworks <span style="font-size: 9px;">(ho ho)</span></strong></p>
<p>But there are downsides. Given the number of frameworks out there it&#8217;s quite easy to be overwhelmed and to worry that you&#8217;re using X when you should be using Y, or that if you only used Z your life would be Just Awesome™. My approach has been to proceed with caution &#8211; don&#8217;t assume you need something just because it&#8217;s new and shiny. Even when I have come across something that looks genuinely useful, my experience is that it takes time to overhaul my workflow to integrating new tools and practices, and attempting to do too much at once can be really confusing and ultimately counterproductive if those new tools or code conflict or create new and novel administrative burdens. I personally find it more effective to note down new tools/approaches/ideas as I find them (while reading blogs or web dev sites) and play with them outside first in a sandbox, outside of the real development context, to find out whether there would be real value in integrating them properly into my workflow.</p>
<p><strong>A problem that didn&#8217;t need solving</strong></p>
<p>I&#8217;ve lost count of how many web &#8216;apps&#8217; I&#8217;ve signed up to which are supposed to enhance my productivity but which I&#8217;ve realised, on reflection, don&#8217;t actually solve any problem I&#8217;m experiencing. Web 2.0 is littered with these answers to problems that don&#8217;t exist &#8211; and as much as I admire the entrepreneurial zeal of the starry-eyed Zuckerbergs who create them, the vast majority do seem destined to fold sooner or later, and no amount of 1px white text shadow and noisy background textures is likely to change that.</p>
<p><strong>Nagging doubts</strong></p>
<p>Depending on where you rank on the perfectionist scale, frameworks can also have the welcome side-effect of making you constantly feel like there&#8217;s unfinished business with your past projects &#8211; a nagging desire to retrospectively inject some of the new whizzbang skills you&#8217;ve acquired to bring those oldies up to the cutting edge. It&#8217;s worth remembering that you were working with what you knew <em>at the time</em>, and if everything was and still is working, and the client was and is happy with it, then you did your job. Most clients have no interest in the gubbins anyway &#8211; if it looks like it works and it smells like it works, then (to them) it works.</p>
<p>It might sound like like I have a downer on frameworks but that&#8217;s not the case at all, and I&#8217;ll describe which ones I use in a later post. My problem isn&#8217;t with frameworks per se; I&#8217;m just wary that all the choice out there can create more problems than it solves. Bizarrely, the incredibly positive trend in the web community towards share techniques and code to make each others&#8217; lives easier can, if we don&#8217;t step back a bit, confuse matters and distract us from concentrating on the core skills necessary to create websites, on both the code and organisational sides.</p>
]]></content:encoded>
			<wfw:commentRss>http://plastikwrap.co.uk/web-development/workflow-tools-and-frameworks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>So, when exactly did we finally &#8216;make poverty history&#8217;?</title>
		<link>http://plastikwrap.co.uk/comment/so-when-exactly-did-we-finally-make-poverty-history/</link>
		<comments>http://plastikwrap.co.uk/comment/so-when-exactly-did-we-finally-make-poverty-history/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 17:00:15 +0000</pubDate>
		<dc:creator>laurence</dc:creator>
				<category><![CDATA[comment]]></category>

		<guid isPermaLink="false">http://www.plastikwrap.co.uk/?p=64</guid>
		<description><![CDATA[I&#8217;m only asking because nobody seems to be wearing the little white arm bands any more. I can only assume this is because the fight was fought and won, and poverty has indeed been eradicated &#8211; &#8216;made history&#8217; &#8211; and the world&#8217;s poor are now living it up like the rest of us, buying the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-87" title="Untitled-1" src="http://plastikwrap.co.uk/wp-content/uploads/2011/10/Untitled-11.jpg" alt="" width="419" height="129" /><br />
I&#8217;m only asking because nobody seems to be wearing the little white arm bands any more. I can only assume this is because the fight was fought and won, and poverty has indeed been eradicated &#8211; &#8216;made history&#8217; &#8211; and the world&#8217;s poor are now living it up like the rest of us, buying the latest consumer smack from Apple and congratulating themselves on how they&#8217;ve arrived. That&#8217;s that then. Job done.</p>
<p>But wait, it seems that&#8217;s not quite how things have worked out. Apparently far from being consigned to history, poverty is still alive and kicking &#8211; indeed it&#8217;s creeping closer to home all the time. So where, therefore, have the arm bands gone? Surely &#8216;the message&#8217; still needs to be got out there and awareness still needs to be &#8216;raised&#8217;?</p>
<p><span id="more-64"></span></p>
<p>Apparently not it seems.</p>
<p>I was never comfortable with the whole white arm band fad back in 2005/06, and I&#8217;ve never worn one. I did attend the march in Edinburgh though (and even put on a white shirt, gasp!), because it seemed good to be a part of a singular event which might actually have some kind of effect. The G8 was taking place in Gleneagles Hotel at the time so the eyes of the world, and the most powerful people in it, were likely to be on an event as big as the march.</p>
<p>Back to the arm bands though. Now that I reflect on them after more than 5 years, they annoy me as much as ever. Although the &#8216;movement&#8217; (if you can call something so obviously transient a movement) was self-evidently a positive thing, and the organisers were just using those means available to them which were most likely to chime with the majority of their young audience, what it boiled down to for so many people was nothing more than a cynical and selfish fashion stunt. Putting on that little arm band meant you &#8216;cared&#8217;, you were &#8216;part of something bigger than yourself&#8217;, you sympathised with the plight of the tens of millions of people around the world whose lives are blighted by poverty. Yes, that&#8217;s <em>really</em> what it meant to so many.</p>
<p>No, in fact, what so many really cared about was jumping on a warm and fuzzy bandwagon, passively cosseted in the embrace of a Good Cause while requiring no self-sacrifice, critical thought or effort whatsoever, save for the epically meaningless act of pulling a bracelet onto your wrist. Debasing the positive and valuable charitable message that lay beneath the Make Poverty History campaign to satisfy some empty craving to belong was just contemptible. And the evidence that this is how so many treated it is plain to see &#8211; or not &#8211; on the naked wrists of those who supposedly cared.</p>
<p><span style="font-size: x-small;">Image by <a href="http://www.flickr.com/photos/neilt/3351175/sizes/m/in/photostream/">Neil T</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://plastikwrap.co.uk/comment/so-when-exactly-did-we-finally-make-poverty-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2 column news and events page list template for concrete5</title>
		<link>http://plastikwrap.co.uk/concrete5/2-column-news-and-events-page-list-template-for-concrete5/</link>
		<comments>http://plastikwrap.co.uk/concrete5/2-column-news-and-events-page-list-template-for-concrete5/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 18:22:48 +0000</pubDate>
		<dc:creator>laurence</dc:creator>
				<category><![CDATA[concrete5]]></category>
		<category><![CDATA[2 columns]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[custom template]]></category>
		<category><![CDATA[page list]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.plastikwrap.co.uk/?p=22</guid>
		<description><![CDATA[Hi all I&#8217;ve been building the theme for a new concrete5 site, and the designers of the site specified a two-column, four-item news area on the homepage, showing news items in descending date order, in a Z shape. This is what the layout looks like: concrete5&#8242;s pagelist block is the best thing for this job, [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all</p>
<p>I&#8217;ve been building the theme for a new <a href="http://www.concrete5.org/r/-/13221">concrete5</a> site, and the <a href="http://www.39stepsstudio.com">designers</a> of the site specified a two-column, four-item news area on the homepage, showing news items in descending date order, in a Z shape. This is what the layout looks like:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-93" title="2column1-300x151" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/2column1-300x151.png" alt="" width="300" height="151" /></p>
<p>concrete5&#8242;s pagelist block is the best thing for this job, but I wasn&#8217;t sure how to make it play such that (a) the news items would show in two columns, and (b) the items would be displayed in reverse chronological order, in a layout like this:</p>
<div style="width: 200px; margin: auto;">
<table style="width: 200px; font-size: 2em; font-weight: bold; font-family: Georgia,Palatino,Palatino Linotype,Times,Times New Roman,serif;" cellspacing="0">
<tbody>
<tr>
<td style="text-align: center; padding: 10px;">1</td>
<td style="text-align: center; padding: 10px;">2</td>
</tr>
<tr>
<td style="text-align: center; padding: 10px;">3</td>
<td style="text-align: center; padding: 10px;">4</td>
</tr>
</tbody>
</table>
</div>
<p>People tend to read text on a page in a F-pattern, moving across the top of the page (first row) before down the left-hand side. So it makes sense that news items should flow from top left to top right, down to bottom left then bottom right. More can be seen on <a href="http://www.useit.com/alertbox/reading_pattern.html" target="_blank">Jakob Nielsen&#8217;s web usability site</a>.</p>
<p><span id="more-22"></span></p>
<p>The problem is that in all the CSS implementations of columns that I know, the content in the vertical columns is set out one column at a time. In other words, items 1 and 3 in the table above are in one column, and 2 and 4 are in another. 1 and 3 must be pulled from the database and displayed before 2 and 4 are. Obviously that causes problems when you tell the pagelist block to order things by the most recent page, as for news items &#8211; it wants to spit out the pages in reverse chronological order (1,2,3,4), but to get the CSS and HTML to play ball you need the order to be 1,3,2,4. Here&#8217;s a depiction of the order vs layout problem:</p>
<div style="width: 200px; margin: auto;">
<table style="width: 200px; font-weight: bold; font-family: Georgia,Palatino,Palatino Linotype,Times,Times New Roman,serif;" cellspacing="0">
<tbody>
<tr>
<td style="text-align: center;">Column1</td>
<td style="text-align: center;">Column2</td>
</tr>
<tr>
<td style="font-size: 2em; text-align: center; border: 1px solid red; border-bottom: none; padding: 10px;">1</td>
<td style="font-size: 2em; text-align: center; border: 1px solid green; border-bottom: none; padding: 10px;">2</td>
</tr>
<tr>
<td style="font-size: 2em; text-align: center; border: 1px solid red; border-top: none; padding: 10px;">3</td>
<td style="font-size: 2em; text-align: center; border: 1px solid green; border-top: none; padding: 10px;">4</td>
</tr>
</tbody>
</table>
</div>
<p>How to get round this?</p>
<p>Well firstly, to get the columns working I&#8217;m using the code from <a href="http://matthewjamestaylor.com/blog/perfect-2-column-double-page.htm" target="_blank">Matthew James Taylor&#8217;s site</a>. He has published numerous standards-compliant and cross-browser (phew) CSS-based layouts, and it&#8217;s fast becoming my defacto place to begin when trying to create anything but the most basic CSS layout. I used the 2 Column Double Page layout, but I think the principle will work whatever layout you choose &#8211; you just have to be methodical about the code that you insert into the layout to generate the page list.</p>
<p>Here is the (edited) CSS layout that I&#8217;m using. You can refer to the page over on Matthew James Taylor&#8217;s site for details on how to tweak his layouts (you have to be quite precise with pixel/percentage amounts in order to keep the layout looking right, so rather than detail that here I&#8217;ll leave that to him &#8211; he did create the layouts after all):</p>
<pre class="brush: css; title: Code; notranslate">

.colmask {
clear:both;
float:left;
width:100%;
overflow:hidden;
}
/* common column settings */
.colleft {
float:left;
width:100%;
position:relative;
}
/* 2 Column (double page) settings */
.doublepage { }
.doublepage .colleft {
right:50%;            /* right column width */
}
.doublepage .col1 {
width:46%;
left:50%;
}
.doublepage .col2 {
width:46%;
left:54%;
}
</pre>
<p>This is a simple liquid two-column layout, with a 4% space between the two columns. Nice and clean. The corresponding HTML looks like this:</p>
<pre class="brush: xml; title: Code; notranslate">
&lt;div class=&quot;colmask doublepage&quot;&gt;
    &lt;div class=&quot;colleft&quot;&gt;
        &lt;div class=&quot;col1&quot;&gt;
          &lt;!-- column 1 content --&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;col2&quot;&gt;
          &lt;!-- column 2 content --&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Now for the interesting part. As mentioned above, the first CSS column has to be populated first, therefore we need concrete5 to spit out items 1 and 3. After that, the second CSS column needs populated with items 2 and 4.</p>
<p>The way to achieve this is to create a couple of loops, one displaying items 1 and 3 from the array of possible pages, and the other displaying items 2 and 4 from the array. It&#8217;s pretty basic PHP, but it works!</p>
<p>The code for column one looks like this:</p>
<pre class="brush: php; title: Code; notranslate">
		&lt;?php
		for ($i = 0; $i &lt; 3; $i+=2 ) {
		$cobj = $cArray[$i];
		$title = $cobj-&gt;getCollectionName();
		?&gt;
			&lt;h3&gt;&lt;a href=&quot;&lt;?php echo $nh-&gt;getLinkToCollection($cobj)?&gt;&quot;&gt;&lt;?php echo $title?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;div class=&quot;news_summary&quot;&gt;
			&lt;?php
			if(!$controller-&gt;truncateSummaries){
				echo $cobj-&gt;getCollectionDescription();
			}else{
				echo $textHelper-&gt;shorten($cobj-&gt;getCollectionDescription(),$controller-&gt;truncateChars) . ' &lt;span class=&quot;newsmore&quot;&gt;&lt;a href=&quot;' . $nh-&gt;getLinkToCollection($cobj) . '&quot;&gt;more&lt;/a&gt;&lt;/span&gt;';
			}
			echo '&lt;br /&gt;&lt;div class=&quot;newsdate&quot;&gt;Posted ' . $cobj-&gt;getCollectionDateAdded('j F Y');
			?&gt;
			&lt;/div&gt;
		&lt;?php
		}
		?&gt;
</pre>
<div style="width: 200px; margin: auto;">
<table style="width: 200px; font-weight: bold; font-family: Georgia,Palatino,Palatino Linotype,Times,Times New Roman,serif;" cellspacing="0">
<tbody>
<tr>
<td style="text-align: center;">Column1</td>
<td style="text-align: center;">Column2</td>
</tr>
<tr>
<td style="font-size: 2em; text-align: center; border: 1px solid red; border-bottom: none; padding: 10px;">1</td>
<td style="font-size: 2em; text-align: center; padding: 10px;"></td>
</tr>
<tr>
<td style="font-size: 2em; text-align: center; border: 1px solid red; border-top: none; padding: 10px;">3</td>
<td style="font-size: 2em; text-align: center; padding: 10px;"></td>
</tr>
</tbody>
</table>
</div>
<p>The crucial bit is the beginning of the for loop on line 2. $i equals 0 on the first iteration of the loop. PHP arrays by default begin at 0 instead of 1, so the first item in the array is item zero, the second is item one, the third is item two and so on. On loop iteration 1, therefore, we display the first item in the array (item 0, which corresponds to the first page which matches the page list rules set in the page list block interface). $i is then incremented by 2 ($i+=2 is shorthand for $i = $i + 2). So $i now equals 2 (0+2). The loop therefore spits out the third item in the array, which corresponds to the third page matching the block&#8217;s rules. Excellent. We therefore have the first and third pages appearing in our first CSS column. Note that because the loop will only execute while $i is less than 3, it means that it will never get beyond two iterations, because on the third iteration $i would equal more than three.</p>
<p>Here is the code for the second column:</p>
<pre class="brush: php; title: Code; notranslate">
&lt;?php
		for ($i = 1; $i &lt; 4; $i+=2 ) {
		$cobj = $cArray[$i];
		$title = $cobj-&gt;getCollectionName();
		?&gt;
			&lt;h3&gt;&lt;a href=&quot;&lt;?php echo $nh-&gt;getLinkToCollection($cobj)?&gt;&quot;&gt;&lt;?php echo $title?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;div class=&quot;news_summary&quot;&gt;
			&lt;?php
			if(!$controller-&gt;truncateSummaries){
				echo $cobj-&gt;getCollectionDescription();
			}else{
				echo $textHelper-&gt;shorten($cobj-&gt;getCollectionDescription(),$controller-&gt;truncateChars) . ' &lt;span class=&quot;newsmore&quot;&gt;&lt;a href=&quot;' . $nh-&gt;getLinkToCollection($cobj) . '&quot;&gt;more&lt;/a&gt;&lt;/span&gt;';
			}
			echo '&lt;br /&gt;&lt;div class=&quot;newsdate&quot;&gt;Posted ' . $cobj-&gt;getCollectionDateAdded('j F Y');
			?&gt;
			&lt;/div&gt;
		&lt;?php
		}
		?&gt;
</pre>
<div style="width: 200px; margin: auto;">
<table style="width: 200px; font-weight: bold; font-family: Georgia,Palatino,Palatino Linotype,Times,Times New Roman,serif;" cellspacing="0">
<tbody>
<tr>
<td style="text-align: center;">Column1</td>
<td style="text-align: center;">Column2</td>
</tr>
<tr>
<td style="font-size: 2em; text-align: center; padding: 10px;"></td>
<td style="font-size: 2em; text-align: center; border: 1px solid red; border-bottom: none; padding: 10px;">2</td>
</tr>
<tr>
<td style="font-size: 2em; text-align: center; padding: 10px;"></td>
<td style="font-size: 2em; text-align: center; border: 1px solid red; border-top: none; padding: 10px;">4</td>
</tr>
</tbody>
</table>
</div>
<p>Just a tiny tweak to the for loop here. Now we start with $i equalling 1, which refers to the second item in the array (remember the array&#8217;s items start at 0, therefore 1 is the second item &#8211; 0,1,2,3). Once that&#8217;s displayed, $i is again incremented by 2, so it now equals 3 (its original value of 1, plus 2). Item 3 in the array is in fact the fourth item in that array (0,1,2,3&#8230;), which corresponds to the fourth page. Again, because the loop will only execute while $i equals less than 4, it will only iterate twice, because on the third iteration $i would equal 6.</p>
<p>Stick the HTML and PHP together and you get this:</p>
<pre class="brush: php; title: Code; notranslate">
&lt;div class=&quot;colmask doublepage&quot;&gt;
	&lt;div class=&quot;colleft&quot;&gt;
		&lt;div class=&quot;col1&quot;&gt;
		&lt;?php
		for ($i = 0; $i &lt; 3; $i+=2 ) {
		$cobj = $cArray[$i];
		$title = $cobj-&gt;getCollectionName();
		?&gt;
			&lt;h3&gt;&lt;a href=&quot;&lt;?php echo $nh-&gt;getLinkToCollection($cobj)?&gt;&quot;&gt;&lt;?php echo $title?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;div class=&quot;news_summary&quot;&gt;
			&lt;?php
			if(!$controller-&gt;truncateSummaries){
				echo $cobj-&gt;getCollectionDescription();
			}else{
				echo $textHelper-&gt;shorten($cobj-&gt;getCollectionDescription(),$controller-&gt;truncateChars) . ' &lt;span class=&quot;newsmore&quot;&gt;&lt;a href=&quot;' . $nh-&gt;getLinkToCollection($cobj) . '&quot;&gt;more&lt;/a&gt;&lt;/span&gt;';
			}
			echo '&lt;br /&gt;&lt;div class=&quot;newsdate&quot;&gt;Posted ' . $cobj-&gt;getCollectionDateAdded('j F Y');
			?&gt;
			&lt;/div&gt; &lt;!-- col1 end --&gt;
		&lt;?php
		}
		?&gt;
		&lt;/div&gt; &lt;!-- colleft end --&gt;
		&lt;div class=&quot;col2&quot;&gt;
		&lt;?php
		for ($i = 1; $i &lt; 4; $i+=2 ) {
		$cobj = $cArray[$i];
		$title = $cobj-&gt;getCollectionName();
		?&gt;
			&lt;h3&gt;&lt;a href=&quot;&lt;?php echo $nh-&gt;getLinkToCollection($cobj)?&gt;&quot;&gt;&lt;?php echo $title?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;div class=&quot;news_summary&quot;&gt;
			&lt;?php
			if(!$controller-&gt;truncateSummaries){
				echo $cobj-&gt;getCollectionDescription();
			}else{
				echo $textHelper-&gt;shorten($cobj-&gt;getCollectionDescription(),$controller-&gt;truncateChars) . ' &lt;span class=&quot;newsmore&quot;&gt;&lt;a href=&quot;' . $nh-&gt;getLinkToCollection($cobj) . '&quot;&gt;more&lt;/a&gt;&lt;/span&gt;';
			}
			echo '&lt;br /&gt;&lt;div class=&quot;newsdate&quot;&gt;Posted ' . $cobj-&gt;getCollectionDateAdded('j F Y');
			?&gt;
			&lt;/div&gt;
		&lt;?php
		}
		?&gt;
		&lt;/div&gt;
&lt;/div&gt;
</pre>
<p style="text-align: left;">Save the above into a new page list template in your /blocks/page_list/templates/ folder, then you can apply it using the Custom Templates option on the block menu (shown below). Add the css above into your theme&#8217;s css file and you should be good to go.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-92" title="2column2-300x178" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/2column2-300x178.png" alt="" width="300" height="178" /></p>
<p>In the code above I&#8217;ve left in some cosmetic additions of my own, for example the date on which the item was posted, and a little &#8216;more&#8217; link at the end of the truncated summary. Obviously you can tweak the css styles of h3 and news_summary to your heart&#8217;s content, or add in other styles to get the look you want.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-93" title="2column1-300x151" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/2column1-300x151.png" alt="" width="300" height="151" /></p>
]]></content:encoded>
			<wfw:commentRss>http://plastikwrap.co.uk/concrete5/2-column-news-and-events-page-list-template-for-concrete5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate Google Site Search into concrete5</title>
		<link>http://plastikwrap.co.uk/concrete5/integrate-google-site-search-into-concrete5/</link>
		<comments>http://plastikwrap.co.uk/concrete5/integrate-google-site-search-into-concrete5/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 13:00:52 +0000</pubDate>
		<dc:creator>laurence</dc:creator>
				<category><![CDATA[concrete5]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[google search]]></category>

		<guid isPermaLink="false">http://www.plastikwrap.co.uk/?p=6</guid>
		<description><![CDATA[Hi all I&#8217;ve just succeeded in adding Google Site Search to my concrete5 site and I thought I&#8217;d share how. This is for sites where you want a search box on every page (for example in the sidebar or header), and the results to display on their own page. Here&#8221;s an example: Google site search [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all</p>
<p>I&#8217;ve just succeeded in adding Google Site Search to my <a href="http://www.concrete5.org/r/-/13221">concrete5</a> site and I thought I&#8217;d share how. This is for sites where you want a search box on every page (for example in the sidebar or header), and the results to display on their own page. Here&#8221;s an example:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-96" title="search-box-207x300" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/search-box-207x300.png" alt="" width="207" height="300" /></p>
<p>Google site search is in many ways better than the c5 search, which isn&#8217;t really surprising given Google&#8217;s core business. Things like internal PDF/DOC/ODT searching and whatnot are helpful too, especially if you&#8217;re building a site with a lot of document downloads (as I am).</p>
<p>Here&#8217;s what I did:<span id="more-6"></span></p>
<p>1. First you need a Google site search account, which you can get here: <a href="http://www.google.com/cse">www.google.com/cse</a>.</p>
<p>When setting up the custom search engine, limit searching to only sites that you select, then add your domain to the text box. You can add more than one if necessary (maybe you&#8217;re building a site for a company has multiple product or service domains?)</p>
<p>Choose either the free or Site Search editions. The latter will remove ads for $100 a year, or if you&#8217;re building for a non-profit, government or university site you can choose the first one and there will be no ads once you&#8217;ve told them as such.</p>
<p>2. Select the &#8216;Iframe&#8217; option at the top of the page, then design your form and results pages by choosing colours etc. Choosing the Iframe option means the results will be embedded into an existing c5 page. I&#8217;ll be using the /search/search-results page, because it is helpfully included in the default installation of c5, but you can use any page you like.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-97" title="cse1-300x59" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/cse1-300x59.png" alt="" width="300" height="59" /></p>
<p>3. Get the code. Once you have designed your form and results on the &#8216;Look and feel&#8217; page, click the Get Code&#8230; button. You will then be presented with three sections. One where you specify the URL of your search results page, one containing the code for your search form and another containing the code which will actually display the search results.</p>
<p>3.1 In the first box (&#8216;Specify search results details&#8217;), enter the full URL of your results page &#8211; for example &#8220;http://www.mysite.com/searc/search-results&#8221; (without quotes). If you want your results to appear on a different page in your c5 hierarchy, put that here instead. It can be anything you like.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-98" title="cse21-300x78" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/cse21-300x78.png" alt="" width="300" height="78" /></p>
<p>3.2 The code in the second block represents the search form which will appear on all your pages. You can paste it into your theme&#8217;s code directly and it will work fine. Applying CSS styles and layouts will allow you to integrate it properly into your site&#8217;s design.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-100" title="cse3-300x135" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/cse3-300x135.png" alt="" width="300" height="135" /></p>
<p style="text-align: left;">Alternatively, you could go add an HTML block to concrete5&#8242;s Scrapbook, into which you&#8217;d paste that code. You&#8217;d then be able to add the search form wherever you liked on your site within c5&#8242;s WYSIWYG interface, clicking &#8216;Add From Scrapbook&#8217; whenever you go to add a block. You could also use the Defaults button in Page Types in the Admin interface, which would allow you to place this block permanently in the place of your choice for a given page type. It depends how comfortable you feel with editing the HTML code directly, and with giving editors the chance to remove the search form from a given page (which they can do if you have it inserted as a default block, assuming there are no advanced permissions set up).</p>
<p>3.3 Once your form is in place, you then need to edit the page specified above at 3.1. Navigate to that page in c5, then go into edit mode. Add an HTML block to the page, then paste in the code from the &#8216;Search results code&#8217; box on the Site Search control panel. Once you&#8217;ve done that, publish you search results page.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-101" title="cse4-300x109" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/cse4-300x109.png" alt="" width="300" height="109" /></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-102" title="cse5-300x295" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/cse5-300x295.png" alt="" width="300" height="295" /></p>
<p>4. You should now be finished! Try searching for something in the form and see if the search results page appears with the correct results, like this:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-103" title="cse6-300x153" src="http://plastikwrap.co.uk/wp-content/uploads/2010/06/cse6-300x153.png" alt="" width="300" height="153" /></p>
<p style="text-align: left;">Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://plastikwrap.co.uk/concrete5/integrate-google-site-search-into-concrete5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

