<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title><![CDATA[clokey2k]]></title>
        <description><![CDATA[clokey2k]]></description>
        <link>http://clokey2k.com</link>
        <generator>RSS for Node</generator>
        <lastBuildDate>Thu, 31 Jul 2014 07:00:58 GMT</lastBuildDate>
        <atom:link href="http://clokey2k.com/feed.xml" rel="self" type="application/rss+xml"/>
        <pubDate>Thu, 31 Jul 2014 07:00:45 GMT</pubDate>
        <item>
            <title><![CDATA[Abstraction - making life simpler]]></title>
            <description><![CDATA[<p>I was thinking the other day that the internet is so much simpler than it used to be. You call up an Interent Service Provider and within a few days you are watching <a href="https://www.youtube.com/watch?v=ORYKKNoRcDc">Youtube until 4am</a>, playing games against friends from accross town, or strangers from America. It&#39;s easy. The average smartphone can allow you to connect to the Internet, select an episode of your favourite TV Series and allow you to watch it within seconds of hitting &quot;Go&quot;. Then I started to question my judgment.
<!-- Read more --></p>
<h2 id="is-it-really-simpler-">Is it Really Simpler?</h2>
<p>It only appears simpler, the complex nature of the internet is mostly hidden - Abstracted away from the user.</p>
<p>In the early days of the internet there were no ISPs. If you wanted to connect to a community <a href="http://en.wikipedia.org/wiki/Bulletin_board_system">bulletin board</a> you had to get your computer modem to dial the phone number of the bulletin board you wanted to connect to. The host of the bulletin board would have to provide a number of lines into their host computer to support a very limited number of users. This area of the Internet was unlikely to be connected to other areas of the internet. Just a few computers talking to each other in a small group.</p>
<p>In walks <a href="http://webfoundation.org/about/sir-tim-berners-lee/">Sir Tim Berners-Lee</a>, with his ideas of a World Wide Web. A set of protocols and rules to set a standard that could open this network up. Things really started to change as the infrastrucure began to grow. Instead of dialling the host directly, the ISP (mostly the guys that provided your phone line in the past) provides you a point of entry and they will route your call. Keeping the telphone analogy going, we have swapped the direct dial phone number to an <a href="http://en.wikipedia.org/wiki/IP_address">Internet Protocol (IP) address</a> like 212.58.244.20. We don&#39;t even have to remember the number because of URLs. Type &quot;<a href="http://bbc.co.uk">bbc.co.uk</a>&quot; and your browser asks for the IP address from a directory (a <a href="http://en.wikipedia.org/wiki/Dns">DNS</a>). Your request for a page then gets sent to the host, via the shortest number of phyiscal machines as possible.</p>
<p>So what used to be a complex set up between to PCs has now included thousands of individual machines whose purpose is to ensure that the route from your PC to anywhere else is known, and that there is a list of URLs are ready to translate into IP addresses. There are load balancers, multiple versions of some hosts, cached versions of data and even search engines are providing even more abstraction. You dont even need to know the URL.</p>
<p>You just type &quot;<a href="http://lmgtfy.com/?q=cutest+cat+video&amp;l=1">cutest cat video</a>&quot;, and the full force of the internet parts in front of you giving you what you want.</p>
<p>The same goes for programming code or ordering coffee.</p>
<p>Application Programming Interfaces (APIs) are provided when someone else has taken a complex task and made it easier, and simpler. Take the Android layout inflater, you just give it an XML instruction and it will perform the hard work of rendering objects from the Android API into the places you asked for them.</p>
<pre class="highlight"><code class="hljs java"><span class="hljs-keyword">public</span> View <span class="hljs-title">onCreateView</span>(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   View myFragmentView = inflater.inflate(R.layout.fragmentlayout, container, <span class="hljs-keyword">false</span>);
   <span class="hljs-keyword">return</span> myFragmentView;
}
</code></pre>
<p>A barrista knows that when you ask for a latte, that they should be making a hot drink using espresso coffee and steamed milk.</p>
<h2 id="tl-dr">TL;DR</h2>
<p>The world is not getting simpler, it&#39;s far more complex - but with every innovation someone abstracts the complexity and makes it easier for the next person.</p>
<p>People in the world today are truly:</p>
<blockquote>
<p>Nanos Gigantum Humeris Insidentes
(Standing on the shoulders of giants)</p>
</blockquote>
]]></description>
            <link>http://clokey2k.com/articles/2014/abstraction-a-simplified-story</link>
            <guid isPermaLink="true">http://clokey2k.com/articles/2014/abstraction-a-simplified-story</guid>
            <pubDate>Sun, 25 May 2014 23:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[My first Experience with DocPad and Node.js]]></title>
            <description><![CDATA[<p>I was looking for ways to speed up my website, and short of upgrading the package with my hosting company it was going to be tough. My site has been running on the back of <a href="http://wordpress.org/">Wordpress</a> for quite some time and it has been great. Wordpress has gained momentus traction within the internet communities as a quick way to get a blog up and running.
<!-- Read more --></p>
<p>The problem for me is that the PHP sessions that are created can tax the server of my shared hosting, and occasionally additional requests can peak the memory allowance. This results in the occasional <a href="https://www.google.co.uk/search?hl=en&amp;q=503&amp;meta=#hl=en&amp;q=http%20error%20503">HTTP 503</a> - not good. When the server <em>is</em> running smoothly the amount of time to render a Wordpress page (with plugins) can already take some time. Google Analytics gives an average page load time 5.62s.</p>
<p>I have tried to alleviate this in the past by using a Wordpress cache tool called <a href="http://www.w3-edge.com/wp-plugins/w3-total-cache/">W3 Total Cache</a> - which works. However during cache creation it also causes the occasional HTTP 503.</p>
<h2 id="the-thinking">The Thinking</h2>
<p>Maybe I don&#39;t need all of the features of Wordpress. I don&#39;t need the web server to do anything more than serve the pages that I create. So why not generate the page once and be done with it. Well there will be issues with navigation and sitemaps if those pages aren&#39;t updated evertime a new page is added. Naturally I don&#39;t want to hand author every page that has altered either, so I set about looking for a static site framework, or generation tool.</p>
<p>I&#39;m a programmer at heart, so I am quite capable of putting a little bit of extra work - maybe I set up a <a href="http://www.wampserver.com/">local PHP / MySQL server</a> and use Wordpress as a generation tool, and then upload the generated pages - that could be difficult to maintain, with some pages not required in a static environment.</p>
<p>So I found <a href="http://docpad.org/">DocPad</a> an OpenSource project running on <a href="http://nodejs.org/">Node.js</a>. Although the project hits all of the current <em>Buzzwords</em> it matches what I need.</p>
<h2 id="what-do-i-need-">What do I need?</h2>
<p>DocPad is very lightweight to start with. Basic setup allows for basic server setup and file watching, but it is ready for <a href="http://docpad.org/docs/plugins">Plugins/Modules</a> galore. There are some <a href="http://docpad.org/docs/skeletons">skeletons</a> available to get started, but I like reinventing the wheel so I start with a blank slate - and go browsing the plugin list.</p>
<ul>
<li><strong><a href="https://github.com/docpad/docpad-plugin-eco/">docpad-plugin-eco</a></strong> - basic template engine, pretty much required to create some logic within pages, easy to use.</li>
<li><strong><a href="https://github.com/docpad/docpad-plugin-partials/">docpad-plugin-partials</a></strong> - useful way to include snippets from additional files.</li>
<li><strong><a href="https://github.com/docpad/docpad-plugin-marked/">docpad-plugin-marked</a></strong> - Markdown parsing, should make writing articles quickly.</li>
<li><strong><a href="https://github.com/docpad/docpad-plugin-stylus/">docpad-plugin-stylus</a></strong> - Stylus support, to make CSS authoring easier</li>
<li><strong><a href="https://github.com/docpad/docpad-plugin-highlightjs/">docpad-plugin-highlightjs</a></strong> - Used with Markdown support to Highlight code within my articles.</li>
<li><strong><a href="https://github.com/docpad/docpad-plugin-livereload/">docpad-plugin-livereload</a></strong> - Development tool for the local server, using WebSockets to reload the page while editing for instant preview.</li>
<li><strong><a href="https://github.com/docpad/docpad-plugin-cleanurls/">docpad-plugin-cleanurls</a></strong> - Creates URLs like <strong>/article/articlename/(index.html)</strong> from <strong>articlename.html</strong>.</li>
</ul>
<p>I recommend getting involved, download Node.js, and Install DocPad give it a try.</p>
<h2 id="result">Result</h2>
<p>It did not take too much time to reconstruct my website from the ground up, and DocPad and Plugins were very accomodating. Only time will determine if it was a good idea to make the change - but for now I am happy with what I have done.</p>
]]></description>
            <link>http://clokey2k.com/articles/2014/my-experience-with-docpad</link>
            <guid isPermaLink="true">http://clokey2k.com/articles/2014/my-experience-with-docpad</guid>
            <pubDate>Sun, 09 Feb 2014 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[Displaying Multiple Routes using Google Maps API]]></title>
            <description><![CDATA[<p>Recently I have been playing around with the Google Maps JavaScript API and it is really intuitive to pick up. If you want to learn something different, <a href="https://developers.google.com/maps/documentation/javascript/tutorial" title="Google Maps - Getting Started">grab an API key and start programming</a>.</p>
<!-- Read more -->

<p><ins datetime="2013-12-06">UPDATE: over time the code boxes on this page gained some additional HTML tags, and lost some formatting - I have now fixed this.</ins>
<ins datetime="2014-02">I have also created <a href="/demos/multiple-routes-on-google-maps">a demo here</a></ins></p>
<h2 id="the-experiment">The Experiment</h2>
<p>Using data that I have collected I decided to visualise my work days on a Google Map. I travel around locally and thought it was a good dataset to start tinkering upon.</p>
<p>This was easier than I thought.</p>
<p>You simply structure a <a href="https://developers.google.com/maps/documentation/javascript/reference#DirectionsRequest" title="DirectionsRequest object - Google Maps API Docs">request object</a> and pass it into to a <a title="DirectionsService - Google Maps API Docs" href="https://developers.google.com/maps/documentation/javascript/reference#DirectionsService">Direction Service Object</a> and wait for Google&#39;s servers to respond via your callback function. After checking that the directions are &quot;OK&quot;, you can iterate through the results object or pass it to a <a title="DirectionsRenderer class - Google Maps API Docs" href="https://developers.google.com/maps/documentation/javascript/reference#DirectionsRenderer">DirectionsRenderer Object</a> provided by the Google API.</p>
<p>That&#39;s it you have <a title="Directions Service - Google Maps API Reference" href="https://developers.google.com/maps/documentation/javascript/directions">requested and displayed a route</a>.</p>
<h2>What if you want another route?</h2>

<p>Making a new request and displaying it using the same renderer object <strong>REPLACES</strong> your existing route. I wanted to display multiple routes on the same map. Not knowing where to begin and my mind drawing a blank I approached Google for inspiration. The only related suggestion was this from StackOverflow:</p>
<p><a href="http://stackoverflow.com/questions/5451770/demo-for-displaying-multiple-google-directions-google-maps-api-v3">http://stackoverflow.com/questions/5451770/demo-for-displaying-multiple-google-directions-google-maps-api-v3</a>.</p>
<p>Which in turn links to an example:</p>
<p><a href="http://joshdcompton.com/google_maps/mult_directions/test.html">http://joshdcompton.com/google_maps/mult_directions/test.html</a>.</p>
<p>Under the hood (a quick &quot;View Source&quot;) provides a solution. Although provided in a bad design pattern it is functional and proves a point. You need a DirectionsRenderer for each route. Multiple DirectionsRenderer objects, sounds like they should be stacked in an Array. This works well:</p>
<pre class="highlight"><code class="hljs javascript"><span class="hljs-comment">// cur is used later to manage the location in the renderArray[]</span>
    <span class="hljs-keyword">var</span> cur = <span class="hljs-number">0</span>;
<span class="hljs-comment">// requestArray - just going to be an array of DirectionRequest Objects, </span>
<span class="hljs-comment">// you need to to populate this!</span>
<span class="hljs-comment">// renderArray - to be used to store multiple DirectionRenderers.</span>
<span class="hljs-comment">// map - the Google Map object.</span>
    <span class="hljs-keyword">var</span> requestArray = [], renderArray = [], map;
<span class="hljs-comment">// Kickstart the process of requesting Directions</span>
    submitRequests();
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">submitRequests</span><span class="hljs-params">()</span>{</span>
    requestLength = requestArray.length
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>;  i &lt; requestLength; i++){
            console.log(<span class="hljs-string">"Submitting request"</span>);
            directionsService.route(requestArray[i], directionResults);
          }
    }
<span class="hljs-comment">/*
 * Callback function provided to the Maps API Direction Service. It creates
 * a new DirectionsRenderer to manage the new route without overriding the
 * old route
 *
 * @param result - the route information
 * @param status - Success or Fail
*/</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">directionResults</span><span class="hljs-params">(result, status)</span> {</span>
        console.log(<span class="hljs-string">"Receiving request for route"</span>);
        <span class="hljs-keyword">if</span> (status == google.maps.DirectionsStatus.OK) {
            renderArray[cur] = <span class="hljs-keyword">new</span> google.maps.DirectionsRenderer();
            renderArray[cur].setMap(map);
            renderArray[cur].setDirections(result);
            cur++
        }
    }
</code></pre>
<p>The Directions service is Asynchronous, which means you have to wait for a response before displaying it, hence a callback method. This also means that the results may not come back in the same order. If you want to associate the route with the request you have to submit each request and then wait for the response. This would allow you to create a Legend, or retrieve information about the route that is appropriate for the request.</p>
<p>I settled for this, after changing the request array to hold a requestID as part of the object:</p>
<pre class="highlight"><code class="hljs javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">processRequests</span><span class="hljs-params">()</span>{</span>
  console.log(<span class="hljs-string">"Processing requests"</span>);
  <span class="hljs-comment">//Counter to track request submission;</span>
  <span class="hljs-keyword">var</span> cur = <span class="hljs-number">0</span>;
  <span class="hljs-keyword">if</span>(renderArray.length &gt; <span class="hljs-number">0</span>){
    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> r=<span class="hljs-number">0</span>; r &lt; renderArray.length; r++){
      console.log(r);
      renderArray[r].setMap(<span class="hljs-literal">null</span>);
    }
  }
  submitRequest();
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">nextRequest</span><span class="hljs-params">()</span>{</span>
    cur++;
    <span class="hljs-keyword">if</span>(cur &gt;= requestArray.length){
      console.log(<span class="hljs-string">"Done"</span>);
      <span class="hljs-keyword">return</span>;
    }
    submitRequest();
  }
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">submitRequest</span><span class="hljs-params">()</span>{</span>
    console.log(<span class="hljs-string">"Submitting request for: "</span>, requestArray[cur].requestID);
    directionsService.route(requestArray[cur].request, directionResults);
  }
  <span class="hljs-comment">/*
  *  Callback function provided to the Maps API Direction Service. It creates
  *  a new DirectionsRenderer to manage the new route without overriding the
  *  old route
  *
  *  @param result - the route information
  *  @param status - Success or Fail
  */</span>
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">directionResults</span><span class="hljs-params">(result, status)</span> {</span>
    console.log(<span class="hljs-string">"Receiving request for route: "</span>, cur);
    <span class="hljs-keyword">if</span> (status == google.maps.DirectionsStatus.OK) {
      renderArray[cur] = <span class="hljs-keyword">new</span> google.maps.DirectionsRenderer();
      renderArray[cur].setMap(map);
      renderArray[cur].setDirections(result);
    }
    nextRequest();
}
</code></pre>
<p>I hope this helps anyone displaying multiple routes, you could also spice it up with an array of colours on each directions renderer? Please note that although this code works, it may not be the &#39;best&#39; solution. It also does not initialise or create the Google map, or provide you with any request data. It is only meant to highlight my solution to a problem.</p>
<p><del>I may put up a live example soon.</del> <ins><a href="/demos/multiple-routes-on-google-maps">Live example here</a></ins></p>
<p>If you need more information, or if something isn&#39;t clear<a title="Contact Me" href="http://clokey2k.com/contact-me/"> let me know</a>, I&#39;m just a <a title="Contact Me" href="http://clokey2k.com/contact-me/">Contact Page</a> away!</p>
]]></description>
            <link>http://clokey2k.com/articles/2012/displaying-multiple-routes-using-google-maps-api/</link>
            <guid isPermaLink="true">http://clokey2k.com/articles/2012/displaying-multiple-routes-using-google-maps-api/</guid>
            <pubDate>Tue, 24 Apr 2012 23:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[IE Conditionals - a class of their own]]></title>
            <description><![CDATA[<p>While looking under the hood of <a href="http://css-tricks.com" title="CSS Tricks">CSS Tricks</a>, a site by the CSS/Wordpress fanatic <a href="http://chriscoyier.net" title="Chris Coyier">Chris Coyier</a> I spotted some very interesting code.</p>
<!-- Read more -->

<p>At first glance it all seemed commented out.</p>
<p>Dig a little deeper and the whole snippet takes shape.</p>
<pre class="highlight"><code class="hljs xml"><span class="hljs-comment">&lt;!--[if lt IE 7]&gt;
    &lt;html class="no-js ie6 ie" lang="en"&gt;
&lt;![endif]--&gt;</span>
<span class="hljs-comment">&lt;!--[if IE 7]&gt;
    &lt;html class="no-js ie7 ie" lang="en"&gt;
&lt;![endif]--&gt;</span>
<span class="hljs-comment">&lt;!--[if IE 8]&gt;
    &lt;html class="no-js ie8 ie" lang="en"&gt;
&lt;![endif]--&gt;</span>
<span class="hljs-comment">&lt;!--[if gt IE 8]&gt;
    &lt;html class="no-js" lang="en"&gt;
&lt;!--&lt;![endif]--&gt;</span>
</code></pre>
<p>I&#39;m used to seeing the condition statement to load <a href="http://css-tricks.com/132-how-to-create-an-ie-only-stylesheet/" title="CSS-Tricks on the matter">IE specific style-sheets</a>, but never such a clever deal as this. Rather than waste another resource download - and possible blocking - Chris can serve just one style-sheet. Using the same methods that has made <a href="http://www.modernizr.com">Modernizer</a> so popular you can target browsers using the HTML class:</p>
<pre class="highlight"><code class="hljs xml">.ie{ //IE generic Styles...}

.ie6{ //IE6 styles...}
</code></pre>
<p>So I Google&#39;d it, and realised that it&#39;s included in the HTML5 boilerplate and documented on <a href="http://paulirish.com/" title="Making the www fun">Paul Irish&#39;s website</a>. Read more about &quot;<a href="http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/" title="Conditional stylesheets vs CSS hacks?">Conditional stylesheets vs CSS hacks? Answer: Neither!</a>&quot; and then send me a message telling me an idiot. Really? I don&#39;t mind!</p>
<p>Maybe I should spend a bit of time reading through Paul Irish&#39;s blog?</p>
]]></description>
            <link>http://clokey2k.com/articles/2011/ie-conditionals-a-class-of-their-own</link>
            <guid isPermaLink="true">http://clokey2k.com/articles/2011/ie-conditionals-a-class-of-their-own</guid>
            <pubDate>Thu, 29 Sep 2011 23:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[Mashables cool 'Next Post' widget]]></title>
            <description><![CDATA[<p>I was reading an article on <a title="Mashable" href="http://mashable.com">Mashable</a> and when I had reached the end of the article this &#39;thing&#39; appeared to the right of the page. This &#39;thing&#39; was promoting the next article on the site, and rather being a boring link it was a full featured snippet shouting &#39;Click Me&#39;.</p>
<p>Things I really like about this &#39;Widget&#39;:</p>
<p><ul>
    <li>It waits patiently until you have finished reading the first article, because that is why you are there right?</li>
    <li>It pops up over all the other junk that makes the page busy. Saving valuable real estate, until need.</li>
    <li>It includes more than just the title, helping us with that big &#39;shall I click?&#39; decision.</li>
</ul></p>
<p><h2>Easy to Make</h2>
I think so.</p>
<p>Using the favourite <a title="jQuery Coolness" href="http://jquery.com"> jQuery</a> - <em>or straight JavaScript if you are capable -  </em>you can test the current scroll position against the bottom of the article (or any target element). Once the numbers add up bring in an absolutely positioned panel with all the coolness of a pro.</p>
<p>This works, but not the cleanest of code - but functional! Also available as a fiddle: <a title="Next Article Fiddle" href="http://jsfiddle.net/clokey2k/rcaxA/1/">http://jsfiddle.net/clokey2k/rcaxA/1/</a></p>
<pre class="highlight"><code class="hljs javascript">$(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span>{</span>

  <span class="hljs-comment">//When should it be triggered in this case - when the '.next-link' is visible, </span>
  <span class="hljs-comment">//but it could be the '.offset().bottom' of the article?</span>
  limit = $(<span class="hljs-string">'.next-link'</span>).offset().top;
  <span class="hljs-comment">//Account for the height of the window - would have to readjust on resize;</span>
  target = limit - $(window).height();
  <span class="hljs-comment">//Hide the fancy fixed position box;</span>
  $nextbox = $(<span class="hljs-string">'.next-box'</span>)
  $nextbox.css({right: <span class="hljs-string">"-=150px"</span>});
  <span class="hljs-comment">//Make a note of it's status;</span>
  visible = <span class="hljs-literal">false</span>

  <span class="hljs-comment">//Cue Magic - every time the window scrolls;</span>
  $(window).scroll(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span>{</span>
    <span class="hljs-comment">//Where are we?</span>
    current =  $(window).scrollTop();
    <span class="hljs-comment">//Hit the target - show me the box;</span>
    <span class="hljs-keyword">if</span>(current &gt;= target &amp;&amp; visible == <span class="hljs-literal">false</span>){
      $nextbox.animate({right: <span class="hljs-string">"+=150px"</span>}, <span class="hljs-number">500</span>);
      visible = <span class="hljs-literal">true</span>;
    }
    <span class="hljs-comment">//Gone back up to re-read the article - hide it again!</span>
    <span class="hljs-keyword">if</span>(current &lt; target &amp;&amp; visible == <span class="hljs-literal">true</span>){
      $nextbox.animate({right: <span class="hljs-string">"-=150px"</span>}, <span class="hljs-number">500</span>);
      visible = <span class="hljs-literal">false</span>;
    };
  });
});
</code></pre>
<p>Result being (rather poorly styled):</p>
<p><figure><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/clokey2k/rcaxA/1/embedded/result/" width="320" height="240"></iframe></figure>
This currently relies on knowing the width of the pop-up box to hide it adequately, but jQuery could find the width and adjust accordingly. Some values would have to be recalculated if the window is resized (as the height of the window and &#39;length&#39; of the article would increase), especially if  widths of elements are fluid. As long as you are aware it shouldn&#39;t take long to adjust!</p>
<p><del>Just visit <a title="Mashable" href="http://mashable.com">Mashable</a> and read an article, who knows what article comes next.</del>
<ins>Since writing this article Mashable have changed their webdesign</ins></p>
]]></description>
            <link>http://clokey2k.com/articles/2011/mashables-cool-next-post-widget</link>
            <guid isPermaLink="true">http://clokey2k.com/articles/2011/mashables-cool-next-post-widget</guid>
            <pubDate>Wed, 07 Sep 2011 23:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[sectioned-page WordPress Page Template]]></title>
            <description><![CDATA[<p>I <del>use</del> <ins>preivously used</ins> this code on my site to display my projects page, which essentially is an intro paragraph (the contents of the Project WordPress page), followed by the children page listed within the same view.</p>
<!-- Read More -->

<p>For me this means that all of my projects can be listed on one page but edited separately. It could also be used to aid writing an article by splitting it into sections.</p>
<p>This does come with limitations:</p>
<ul>
<li>No pagination – I don’t think it will work if page 2 or more is requested.</li>
<li>No REAL Child pages – as you are already displaying them, although they can be viewed as single pages themselves.</li>
<li>Duplicated content – The same / similar information is available in more than one location</li>
</ul>
<p>But without further ado – the code:</p>
<pre class="highlight"><code class="hljs xml"><span class="php"><span class="hljs-preprocessor">&lt;?php</span>  <span class="hljs-comment">/* Start the Main Loop. */</span><span class="hljs-preprocessor">?&gt;</span></span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-variable">$post_parent</span>=<span class="hljs-number">0</span>; <span class="hljs-comment">//Declaring it out of the loop for use later (might not be needed) ?&gt;</span></span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-keyword">while</span> ( have_posts() ) : the_post(); <span class="hljs-preprocessor">?&gt;</span></span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-comment">/* Display the single page. */</span> <span class="hljs-preprocessor">?&gt;</span></span>
    <span class="hljs-tag">&lt;<span class="hljs-title">article</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">""</span>&gt;</span>
      //code for diplaying the holding page - maybe an intro? or blank...
    <span class="hljs-tag">&lt;/<span class="hljs-title">article</span>&gt;</span>
    <span class="php"><span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-variable">$post_parent</span>= the_ID(); <span class="hljs-comment">//Setting it to the current post/page ID ?&gt;</span></span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-keyword">endwhile</span>; <span class="hljs-comment">// End the main loop. Carrying the $post_parent through; ?&gt;</span></span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span> query_posts(<span class="hljs-string">'post_type=page&amp;post_parent='</span>.<span class="hljs-variable">$post_parent</span>); <span class="hljs-comment">//post_parent used to query just children ?&gt;</span></span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span>  <span class="hljs-comment">/* Start the child Loop. */</span><span class="hljs-preprocessor">?&gt;</span></span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-keyword">while</span> ( have_posts() ) : the_post(); <span class="hljs-preprocessor">?&gt;</span></span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-comment">/* How to display all child pages. */</span> <span class="hljs-preprocessor">?&gt;</span></span>
    <span class="hljs-tag">&lt;<span class="hljs-title">article</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">""</span>&gt;</span>
      //code for diplaying the small pages/sections
    <span class="hljs-tag">&lt;/<span class="hljs-title">article</span>&gt;</span>
<span class="php"><span class="hljs-preprocessor">&lt;?php</span> <span class="hljs-keyword">endwhile</span>; <span class="hljs-comment">// End the child loop. ?&gt;</span></span>
</code></pre>]]></description>
            <link>http://clokey2k.com/articles/2010/sectioned-page-wordpress-page-template/</link>
            <guid isPermaLink="true">http://clokey2k.com/articles/2010/sectioned-page-wordpress-page-template/</guid>
            <pubDate>Sat, 11 Dec 2010 00:00:00 GMT</pubDate>
        </item>
    </channel>
</rss>