<?xml version="1.0" encoding="utf-8"?><!-- generator="Kirby" -->

<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">

  <channel>
    <title>Kirby news and tutorials</title>
    <link>http://www.getkirby.com/blog</link>
    <generator>Kirby</generator>
    <lastBuildDate>Thu, 17 May 2012 23:22:44 +0000</lastBuildDate>
    <atom:link href="http://www.getkirby.com/blog/feed" rel="self" type="application/rss+xml" />

        <description>The latest updates and tutorials for Kirby CMS.</description>
      
        <item>
      <title>The Kirby Forum</title>  
      <link>http://www.getkirby.com/blog/the-forum</link>
      <guid>http://www.getkirby.com/blog/the-forum</guid>
      <pubDate>Wed, 16 May 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p>It has been on my todo list for a long time and I'm very happy to announce that today I'm officially launching the brand new <a href="http://www.getkirby.com/forum"><strong>Kirby Forum</strong></a>.</p>

<p>The forum will be there for you to get connected with each other, to get and offer support and to simply talk about all kinds of Kirby-related topics. I hope it will become a great place, where we all can discuss and exchange ideas, where you can hunt me down for bugs and which will hopefully become some kind of Kirby-community-brain.</p>

<h2>Forum Threads</h2>

<p><strong><a href="http://www.getkirby.com/forum/general">General</a></strong> <br />
Pretty much anything that won't fit into the other threads.</p>

<p><strong><a href="http://www.getkirby.com/forum/issue-tracker">Issue Tracker</a></strong><br />
Found a bug? Submit it here!</p>

<p><strong><a href="http://www.getkirby.com/forum/extensions">Extensions</a></strong><br />
Got an idea for a plugin, or you've created a new snippet? Tell us about it!</p>

<p><strong><a href="http://www.getkirby.com/forum/panel">The Panel</a></strong><br />
Especially while the Panel is still in beta, this is the place to submit your feature requests, issues or anything else, which is related to the <a href="http://www.getkirby.com/panel">Kirby Panel</a>.</p>

<p><strong><a href="http://www.getkirby.com/forum/job-board">Job Board</a></strong><br />
You are looking for someone to help you with a Kirby project? <br />
You are a developer, who's looking for work? Get connected here.</p>

<h3>Anything missing?</h3>

<p>Do you feel like a thread is missing? Anything else you want to discuss in the forum? Please let me know: <a href="&#109;&#97;&#105;&#108;&#x74;&#x6f;&#x3a;&#x62;a&#115;&#116;&#105;&#x61;&#x6e;&#x40;&#x67;e&#116;&#107;&#105;&#114;&#x62;&#x79;&#x2e;&#x63;&#111;&#109;">&#x62;a&#115;&#116;&#105;&#x61;&#x6e;&#x40;&#x67;e&#116;&#107;&#105;&#114;&#x62;&#x79;&#x2e;&#x63;&#111;&#109;</a></p>

<h2>How can I join?</h2>

<p>Anybody, who's got a <strong>Twitter account</strong> can login to the <a href="http://www.getkirby.com/forum">Kirby Forum</a> The good thing: you don't need another account and I don't have to store your passwords on the Kirby server.</p>

<h2>Built with Kirby</h2>

<p>The Forum is entirely built on Kirby – no forum software involved.</p>

<p><img src="http://www.getkirby.com/content/06-blog/60-the-forum/01.png" alt="Kirby" /></p>

<p>It's a simple plugin, which will be available for all Kirby users soon. It uses regular Kirby content folders for threads, the same plugin, templates and snippets system and a MySQL database for topics, users and posts. You can add it to any existing Kirby page or build a dedicated forum site with it. Stay tuned for updates!</p>

<h2>Get started</h2>

<p>As you will see, the <a href="http://www.getkirby.com/forum">forum</a> is still pretty empty. So please don't be shy and start your first topics.</p>

<p>It's also still a very early version of the forum extension, so please let me know if you run into any bugs.</p>

<p>Can't wait to hear what you think about it and to read your first posts.</p>

<p>Cheers, Bastian</p>
]]></description>      
            
    </item>
        <item>
      <title>The Kirby Cheat Sheet</title>  
      <link>http://www.getkirby.com/blog/cheat-sheet</link>
      <guid>http://www.getkirby.com/blog/cheat-sheet</guid>
      <pubDate>Fri, 11 May 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p>I'm very happy to introduce you to the new <strong><a href="http://cl.ly/GXBe">Kirby Cheat Sheet.</a></strong></p>

<p><a href="http://cl.ly/GXBe"><img src="http://www.getkirby.com/content/06-blog/59-cheat-sheet/01.jpg" alt="Kirby" /></a></p>

<p>It's bascially the entire Kirby API on two DIN A4 pages.</p>

<p><a href="http://cl.ly/GXBe"><img src="http://www.getkirby.com/content/06-blog/59-cheat-sheet/02.png" alt="Kirby" /></a></p>

<p>I hope you like it and it will help you to get stuff done faster with Kirby.</p>
]]></description>      
            
    </item>
        <item>
      <title>Panel 0.7 &#8211; First Beta Release</title>  
      <link>http://www.getkirby.com/blog/panel-0-7</link>
      <guid>http://www.getkirby.com/blog/panel-0-7</guid>
      <pubDate>Wed, 09 May 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p>I've got some great new stuff for all Panel users. It's finally moving out of Alpha state with some great new features.</p>

<h2>Download</h2>

<p>You can <a href="https://github.com/bastianallgeier/kirbycms-panel">download the latest version from Github</a></p>

<h2>How to update</h2>

<p>Updating is easy. Download the latest version and replace the old panel folder with the new panel folder. If you have modified the .htaccess inside the panel folder, make sure to not replace that one.</p>

<h2>Docs</h2>

<p>Check out the <a href="http://www.getkirby.com/panel">Panel docs</a> and please let me know if something is not understandable or missing.</p>

<h2>What's new</h2>

<h3>Edit file metadata</h3>

<p>You can finally add and edit any kind of metadata for files.</p>

<p><img src="http://www.getkirby.com/content/06-blog/58-panel-0-7/01.png" alt="Kirby" /></p>

<p>The cool thing: you can setup the form for metadata in the same way, you can setup the content forms in your blueprints:</p>

<pre class="highlight "><code><span class="html">fields:<br />
&nbsp; title: <br />
&nbsp; &nbsp; label: Title<br />
&nbsp; &nbsp; type: &nbsp;text<br />
&nbsp; text: <br />
&nbsp; &nbsp; label: Text<br />
&nbsp; &nbsp; type: &nbsp;textarea<br />
&nbsp; &nbsp; size: &nbsp;huge<br />
&nbsp; &nbsp; <br />
filefields:<br />
&nbsp; title: <br />
&nbsp; &nbsp; label: Title<br />
&nbsp; &nbsp; type: &nbsp;text<br />
&nbsp; caption:<br />
&nbsp; &nbsp; label: Caption<br />
&nbsp; &nbsp; type: &nbsp;textarea</span></code></pre>

<p>Just add a second field definition – called <code>filefields</code> – below the standard field definition. There's only one limitation. You can only use text fields and textareas. Buttons, required fields, field validation and different field sizes are not available yet.</p>

<p>This will still give you some great flexibility to come up with file metadata just the way you need it.</p>

<h3>iOS Drag &amp; Drop Sorting</h3>

<p>The genius <a href="http://twitter.com/robrainfall">@robrainfall</a> has sent me the link to a <a href="http://touchpunch.furf.com/">great plugin for jQuery UI</a>, which makes it possible to have drag &amp; drop support for sortable lists on iOS devices (iPad, iPhone, iPod) This has been the missing puzzle piece to offer full support for the Panel on the iPad. You can now sit on your couche and update your Kirby-powered website from your iPad!</p>

<h3>New Checkbox and Multicheckbox fields</h3>

<p>With the great support from <a href="https://github.com/lulezi">Luzi Humm</a> there's now a breand new checkbox field, which you can add to your Panel forms. Blueprint setup for this is super easy:</p>

<pre class="highlight "><code><span class="html">mycheckboxfield: <br />
&nbsp; label: &nbsp; My super awesome checkbox<br />
&nbsp; type: &nbsp; &nbsp;checkbox<br />
&nbsp; default: on</span></code></pre>

<p><img src="http://www.getkirby.com/content/06-blog/58-panel-0-7/02.png" alt="Kirby" /></p>

<p>This inspired me to create a new Multicheckbox field, which you can use to provide multiple selections – for example for categories:</p>

<pre class="highlight "><code><span class="html">categories: <br />
&nbsp; label: &nbsp; Categories<br />
&nbsp; type: &nbsp; &nbsp;multicheckbox<br />
&nbsp; default: design, photography<br />
&nbsp; options:<br />
&nbsp; &nbsp; design: Design<br />
&nbsp; &nbsp; photography: Photography<br />
&nbsp; &nbsp; architecture: Architecture</span></code></pre>

<p><img src="http://www.getkirby.com/content/06-blog/58-panel-0-7/03.png" alt="Kirby" /></p>

<p>I think both new field types will come in handy in many situations and I'm happy they are here now. If you are still missing an essential field type, please let me know.</p>

<h3>Multiple Templates</h3>

<p>In your blueprints you can set, which templates subpages should/must have. So far you had the option to either let the user decide or to define a single template, which will be used for all subpages. Now it is possible to define a set of templates, which will give you way more flexibility:</p>

<pre class="highlight "><code><span class="html"># blog blueprint<br />
<br />
title: Blog<br />
<br />
pages: <br />
<br />
&nbsp; template: <br />
&nbsp; &nbsp; - blogarticle<br />
&nbsp; &nbsp; - blogfeed<br />
<br />
&nbsp; sort: &nbsp;flip<br />
&nbsp; limit: 10<br />
<br />
fields: <br />
&nbsp; …</span></code></pre>

<p>You can add any number of templates to the list and the Panel will automatically create a selectbox out of it:</p>

<p><img src="http://www.getkirby.com/content/06-blog/58-panel-0-7/04.png" alt="Kirby" /></p>

<h2>Feedback</h2>

<p>I think it has been very important to add those new features and I'm very happy that they are finally here. I'm excited as always about your feedback.</p>

<p>The final launch of the Panel is drawing nearer. YAY!</p>
]]></description>      
            
    </item>
        <item>
      <title>Quick Tip: Set a different homepage title</title>  
      <link>http://www.getkirby.com/blog/quicktip-homepage-title</link>
      <guid>http://www.getkirby.com/blog/quicktip-homepage-title</guid>
      <pubDate>Tue, 08 May 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p>Setting the HTML title tag with Kirby is easy. <br />
You can use the site wide <code>$site-&gt;title()</code> in connection with the title of the current page <code>$page-&gt;title</code> to generate something pretty decent:</p>

<pre class="highlight "><code><span class="html"><span class="sc2"><span class="kw2">&lt;title&gt;</span></span><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> html<span class="br0">&#40;</span><span class="re0">$site</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span> . <span class="st0">' – '</span> . <span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><span class="sc2"><span class="kw2">&lt;/title&gt;</span></span></span></code></pre>

<p>…or…</p>

<pre class="highlight "><code><span class="html"><span class="sc2"><span class="kw2">&lt;title&gt;</span></span><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> html<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span> . <span class="st0">' | '</span> . <span class="re0">$site</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><span class="sc2"><span class="kw2">&lt;/title&gt;</span></span></span></code></pre>

<p>…just however you prefer.</p>

<p>But what if you want to have a very descriptive title for your homepage or just the site title, without adding an extra template for it?</p>

<p>Kirby has the built-in <code>$page-&gt;isHomepage()</code> function, which makes it fairly simple to change your title only on the homepage:</p>

<pre class="highlight "><code><span class="html"><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">isHomepage</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>: <span class="kw4">?&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;title&gt;</span></span>Welcome to my fantastic, awesome, little website<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
<span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">else</span>: <span class="kw4">?&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;title&gt;</span></span><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> html<span class="br0">&#40;</span><span class="re0">$site</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span> . <span class="st0">' – '</span> . <span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
<span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">endif</span> <span class="kw4">?&gt;</span></span></span></code></pre>

<p>…or maybe just…</p>

<pre class="highlight "><code><span class="html"><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">isHomepage</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>: <span class="kw4">?&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;title&gt;</span></span><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> html<span class="br0">&#40;</span><span class="re0">$site</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
<span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">else</span>: <span class="kw4">?&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;title&gt;</span></span><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> html<span class="br0">&#40;</span><span class="re0">$site</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span> . <span class="st0">' – '</span> . <span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
<span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">endif</span> <span class="kw4">?&gt;</span></span></span></code></pre>
]]></description>      
            
    </item>
        <item>
      <title>Multi-Language Preview</title>  
      <link>http://www.getkirby.com/blog/multilang-preview</link>
      <guid>http://www.getkirby.com/blog/multilang-preview</guid>
      <pubDate>Mon, 23 Apr 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p>I've been working on a multi-language version for Kirby for quite some time and it already found its way into a client project. Today I'm happy to release a first preview, which you can test for your own purpose.</p>

<p>You can get the latest version on Github: <br />
<a href="https://github.com/bastianallgeier/kirbycms/tree/multilanguage">https://github.com/bastianallgeier/kirbycms/tree/multilanguage</a></p>

<p>It works exactly like the default version of Kirby and has only a few adjustments. So if you want to use it for an existing project, all you need to do is to replace the old kirby folder with the new kirby folder from the download.</p>

<p>Otherwise just get started with the Multi-Language version as you would with the regular version. If you need more help, please <a href="http://www.getkirby.com/docs/getting-started">refer to the docs</a></p>

<h2>What is it all about?</h2>

<p>With the Multi-Language version of Kirby, you can easily creat multilingual sites without any effort. It's as easy as adding another text file for each language to your content folders:</p>

<p><img src="http://www.getkirby.com/content/06-blog/56-multilang-preview/01.png" alt="Kirby" /></p>

<h2>How to activate multi-language support?</h2>

<p>Go to site/config/config.php and activated multi-language support like this:</p>

<pre class="highlight php"><code><span class="php">c::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'lang.support'</span>, <span class="kw1">true</span><span class="br0">&#41;</span>;<br />
c::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'lang.default'</span>, <span class="st0">'en'</span><span class="br0">&#41;</span>;<br />
c::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'lang.available'</span>, <span class="kw1">array</span><span class="br0">&#40;</span><span class="st0">'en'</span>, <span class="st0">'de'</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
c::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'lang.detect'</span>, <span class="kw1">true</span><span class="br0">&#41;</span>;</span></code></pre>

<p>If you are updating from an old version of Kirby, add those lines to your config, because they won't be there yet.</p>

<h3>lang.support</h3>

<p>As soon as <code>lang.support</code> is set to true, Kirby will automatically start to generate language-specific URLs like:</p>

<pre class="highlight "><code><span class="html">http://yourdomain.com/en/blog/article-xyz<br />
http://yourdomain.com/fr/blog/article-xyz<br />
http://yourdomain.com/de/blog/article-xyz</span></code></pre>

<h3>lang.default</h3>

<p>With <code>lang.default</code> you define the default language code, which will be used if no language has been selected yet. It will also be used as a fallback when there's no translation available for content in a different language. This means that you can safely use all the content variables, even if you haven't translated all of them. If there's no translation you will get back the version from your default language.</p>

<h3>lang.available</h3>

<p>Set <code>lang.available</code> to define all available translations. Those language codes correspond with the language codes you will use as appendix to your content filenames.</p>

<h3>lang.detect</h3>

<p>When <code>lang.detect</code> is set to true, Kirby will try to detect the user's language from the user agent string and will try to redirect them to the best matching version of your site.</p>

<h2>Multi-Language Content Files</h2>

<p>To translate your content, all you need to do is to duplicate your content text files and add the language code as appendix (before the file extension). For example if your content text file for a blog article is called <code>article.txt</code>, duplicate it and create translations like this:</p>

<pre class="highlight "><code><span class="html">article.de.txt <br />
article.it.txt <br />
article.fr.txt</span></code></pre>

<p>You can decide if you want to add a language code to the original file as well. Otherwise it will be considered as English if your default language is set to <code>en</code> or whatever you set your default language to.</p>

<p>Creating those translation files is optional. You won't break anything if they are not there. You will just not get a translation :)</p>

<h3>site.txt</h3>

<p>The site.txt can be translated in the same way:</p>

<pre class="highlight "><code><span class="html">site.de.txt<br />
site.it.txt<br />
site.fr.txt</span></code></pre>

<h2>Static Language Variables</h2>

<p>If you need site-wide translatable variables, you can either put them into site.txt and its translations, or you can do the following.</p>

<p>Add a new <code>languages</code> folder to your site folder. Add additional PHP files for each language. For example:</p>

<pre class="highlight "><code><span class="html">site/languages/en.php<br />
site/languages/de.php<br />
site/languages/it.php<br />
site/languages/fr.php</span></code></pre>

<p>Define your site-wide translatable variables in those files like this:</p>

<pre class="highlight php"><code><span class="php"><span class="kw4">&lt;?php</span><br />
<br />
l::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'next'</span>, <span class="st0">'weiter'</span><span class="br0">&#41;</span>;<br />
l::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'back'</span>, <span class="st0">'zurück'</span><span class="br0">&#41;</span>;<br />
l::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'ok'</span>, <span class="st0">'ok'</span><span class="br0">&#41;</span>;<br />
l::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'cancel'</span>, <span class="st0">'abbrechen'</span><span class="br0">&#41;</span>;<br />
<br />
<span class="kw4">?&gt;</span></span></code></pre>

<p>You can now use them in your templates, snippets and plugins like this:</p>

<pre class="highlight php"><code><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> l::<span class="me2">get</span><span class="br0">&#40;</span><span class="st0">'next'</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span></code></pre>

<h2>The Panel</h2>

<p><a href="http://www.getkirby.com/panel">The Panel</a> already has support for the multi-language version, so you don't need to update that if you run <a href="http://www.getkirby.com/blog/panel-0-6">Panel 0.6</a> As soon as you switch on language support a select box should appear in the Panel sidebar.</p>

<p><img src="http://www.getkirby.com/content/06-blog/56-multilang-preview/02.png" alt="Kirby" /></p>

<h2>Missing stuff</h2>

<p>The preview should be pretty stable, but there are a few missing things, which I need to add in the next weeks.</p>

<p>If you are using additional content files to add captions or other meta info to your images for example, there's no way yet to translate those.</p>

<p>I haven't found a good way yet to translate URLs. As you know all URLs in Kirby are built by the structure in your content folder. This means that you can't translate:</p>

<pre class="highlight "><code><span class="html">http://yourdomain.com/en/about-us</span></code></pre>

<p>…to…</p>

<pre class="highlight "><code><span class="html">http://yourdomain.com/en/ueber-uns</span></code></pre>

<p>…for example.</p>

<p>This might be a minor issue in many projects, but in some you might really need that. What you can do so far is to use <code>mod_rewrite</code> to rewrite those URLs manually. But that's not very comfortable of course. If you are a developer and you got a suggestion how to solve this best, I'd really appreciate your help. I want to get this right without bloating the system.</p>

<h2>Do you like it?</h2>

<p>It's really important to hear what you think about it and if there are ways to improve multi-language support.</p>
]]></description>      
            
    </item>
        <item>
      <title>1.0.9</title>  
      <link>http://www.getkirby.com/blog/1-0-9</link>
      <guid>http://www.getkirby.com/blog/1-0-9</guid>
      <pubDate>Fri, 20 Apr 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p><strong><a href="https://github.com/bastianallgeier/kirbycms/zipball/master">1.0.9 is here!</a></strong></p>

<p>It's been a while since the last release, because I put a lot of time into the <a href="http://www.getkirby.com/panel">Kirby Panel</a> But I'm happy to announce that the new version has a few great new features – and of course some bug fixes.</p>

<h2>New Features</h2>

<h3>Markdown Extra</h3>

<p>It's been a very popular request to have support for things like tables, footnotes and other features of the famous <a href="http://michelf.com/projects/php-markdown/extra/">Markdown Extra</a> class by Michel Fortin. So far Kirby used the standard PHP Markdown class, which offers great support for all common Markdown features. It was possible to replace that class in the Kirby core, but it was more of a hack and whenever you wanted to update to a newer Kirby version, the Markdown Extra class would be replaced by the regular class again.</p>

<p>With the latest version, all you need to do, to get Markdown Extra support, is to switch it on in <code>site/config/config.php</code></p>

<pre class="highlight php"><code><span class="php">c::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'markdown.extra'</span>, <span class="kw1">true</span><span class="br0">&#41;</span>;</span></code></pre>

<h3>files::filterBy()</h3>

<p>You were able to filter pages by fields for quite a while. For example to filter pages by tags:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$filtered</span> <span class="kw5">=</span> <span class="re0">$page</span>-&gt;<span class="me1">children</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me1">filterBy</span><span class="br0">&#40;</span><span class="st0">'tags'</span>, <span class="st0">'design'</span>, <span class="st0">','</span><span class="br0">&#41;</span>;</span></code></pre>

<p>Now it's also possible to use that on files:</p>

<pre class="highlight php"><code><span class="php"><span class="co1">// get all jpgs</span><br />
<span class="re0">$filtered</span> <span class="kw5">=</span> <span class="re0">$page</span>-&gt;<span class="me1">files</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me1">filterBy</span><span class="br0">&#40;</span><span class="st0">'extension'</span>, <span class="st0">'jpg'</span><span class="br0">&#41;</span>;<br />
<br />
<span class="co1">// get all files with a particular name</span><br />
<span class="re0">$filtered</span> <span class="kw5">=</span> <span class="re0">$page</span>-&gt;<span class="me1">files</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me1">filterBy</span><span class="br0">&#40;</span><span class="st0">'name'</span>, <span class="st0">'somename'</span><span class="br0">&#41;</span>;</span></code></pre>

<h3>404 Error headers</h3>

<p>So far, error pages were served with a regular 200 HTTP status code, which is of course not correct. Now a proper 404   code will be sent for error pages.</p>

<p>For more information about changes, take a look at the <a href="https://github.com/bastianallgeier/kirbycms/blob/master/kirby/changelog.mdown">Changelog</a></p>

<h2>How to update?</h2>

<p>Download the <strong><a href="https://github.com/bastianallgeier/kirbycms/zipball/master">latest version</a></strong> and extract the ZIP. Remove the old kirby system folder from your site and replace it with the new one from the latest version.</p>

<p><strong>Also make sure to empty your cache folder if you have caching enabled</strong></p>
]]></description>      
            
    </item>
        <item>
      <title>Read Later Plugin</title>  
      <link>http://www.getkirby.com/blog/readlater</link>
      <guid>http://www.getkirby.com/blog/readlater</guid>
      <pubDate>Thu, 19 Apr 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p><a href="http://roylodder.com">Roy Lodder</a> has come up with another great extension for Kirby: <a href="https://github.com/bastianallgeier/kirbycms-extensions/blob/master/plugins/readlater/">The Read Later Plugin</a></p>

<p>You can use the plugin to provide handy links for your visitors to save the current page or article with <a href="http://instapaper.com">Instapaper</a> or <a href="http://getpocket.com">Pocket</a>.</p>

<h2>Installation</h2>

<p>Download the <a href="https://github.com/bastianallgeier/kirbycms-extensions/blob/master/plugins/readlater/readlater.php">readlater.php</a> and put it in <code>site/plugins</code> Create the plugins folder if it is not there yet.</p>

<h2>Usage</h2>

<p>Once, the plugin is installed, you can instantly use it in your templates like this:</p>

<pre class="highlight "><code><span class="html"><span class="sc2">&lt;article&gt;</span><br />
&nbsp; <span class="sc2"><span class="kw2">&lt;h1&gt;</span></span><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> html<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><span class="sc2"><span class="kw2">&lt;/h1&gt;</span></span><br />
&nbsp; <span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> kirbytext<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">text</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><br />
<br />
&nbsp; <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">class</span>=<span class="st0">&quot;readlater&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> readlater<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="st0">'instapaper'</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><br />
&nbsp; &nbsp; <span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> readlater<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="st0">'pocket'</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><br />
&nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
<br />
<span class="sc2"><span class="kw2">&lt;</span>/article&gt;</span></span></code></pre>

<p>This will create two links:</p>

<pre class="highlight "><code><span class="html"><span class="sc2"><span class="kw2">&lt;a</span> <span class="kw3">class</span>=<span class="st0">&quot;readlater instapaper&quot;</span> <span class="kw3">href</span>=<span class="st0">&quot;http://www.instapaper.com/hello2?url=http%3A%2F%2Fgetkirby.com%2Fblog%2Freadlater&amp;title=Read+Later+Plugin&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; Add to Instapaper<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;a</span> <span class="kw3">class</span>=<span class="st0">&quot;readlater pocket&quot;</span> <span class="kw3">href</span>=<span class="st0">&quot;https://getpocket.com/save?url=http%3A%2F%2Fgetkirby.com%2Fblog%2Freadlater&amp;title=Read+Later+Plugin&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; Save to Pocket<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span></span></code></pre>

<p>…and you are free to style them with CSS and add them to your templates wherever you want.</p>

<h2>Customization</h2>

<p>If you don't want to use the default link texts (Add to Instapaper &amp; Save to Pocket) you can use your own link texts:</p>

<pre class="highlight "><code><span class="html"><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> readlater<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="st0">'instapaper'</span>, <span class="st0">'Put this on Instapaper'</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><br />
<span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> readlater<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="st0">'pocket'</span>, <span class="st0">'Put it in my Pocket'</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span></span></code></pre>

<h3>Options</h3>

<p>You can also change the CSS selector, target and rel attribute for each link:</p>

<pre class="highlight php"><code><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> readlater<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="st0">'pocket'</span>, <span class="st0">'Read later'</span>, <span class="kw1">array</span><span class="br0">&#40;</span><br />
&nbsp; <span class="st0">'class'</span> &nbsp;=&gt; <span class="st0">'mycustomclass'</span>,<br />
&nbsp; <span class="st0">'target'</span> =&gt; <span class="st0">'_blank'</span>,<br />
&nbsp; <span class="st0">'rel'</span> &nbsp; &nbsp;=&gt; <span class="st0">'somerelattribute'</span><br />
<span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw4">?&gt;</span></span></code></pre>

<h2>Get involved</h2>

<p>It would be great to have support for <a href="http://readability.com/">Readability</a> or other sharing/read later services. The plugin is very easy to extend, so just get involved and <a href="https://github.com/bastianallgeier/kirbycms-extensions/blob/master/plugins/readlater/">fork the plugin on Github</a>.</p>
]]></description>      
            
    </item>
        <item>
      <title>Kirby Panel 0.6</title>  
      <link>http://www.getkirby.com/blog/panel-0-6</link>
      <guid>http://www.getkirby.com/blog/panel-0-6</guid>
      <pubDate>Mon, 16 Apr 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p>It's been a while since the first <a href="http://www.getkirby.com/blog/panel-alpha">Kirby Panel Alpha</a> has been released and I'm very happy about all the help and positive feedback. Today I'm releasing the <strong><a href="https://github.com/bastianallgeier/kirbycms-panel">next alpha version</a></strong>. There are still a few missing features for 1.0, but I feel the beta is getting closer.</p>

<p>Please understand that not all suggestions from testers are in this next release. You guys had a bunch of awesome ideas, but the entire process of testing and coming up with the first version of the panel is taking longer than expected and I try to get it done finally.</p>

<h2>Download</h2>

<p>You can <a href="https://github.com/bastianallgeier/kirbycms-panel">download the latest version from Github</a></p>

<h2>How to update</h2>

<p>I always try to make updating as simple as possible. What you need to do, is to replace the old panel folder with the new panel folder. If you have modified the .htaccess inside the panel folder, make sure to not replace that one.</p>

<h2>Docs</h2>

<p>For all Panel testers, I've setup the first version of the <a href="http://www.getkirby.com/panel">Panel docs</a>. Please let me know if something is not understandable or missing.</p>

<h2>What's new</h2>

<p>A lot of fixes, new features and translations have gone into this new release.</p>

<h3>Format Buttons</h3>

<p>For all textareas, you can now activate the new format buttons in blueprints.</p>

<p><img src="http://www.getkirby.com/content/06-blog/53-panel-0-6/01.png" alt="Kirby" /></p>

<p>To activate them, add <code>buttons: true</code> to the textarea field definition in your blueprints. Here's an example, how to configure a textarea with buttons in a blueprint:</p>

<pre class="highlight "><code><span class="html">fields:<br />
&nbsp; text: <br />
&nbsp; &nbsp; label: &nbsp; Text<br />
&nbsp; &nbsp; type: &nbsp; &nbsp;textarea<br />
&nbsp; &nbsp; size: &nbsp; &nbsp;large<br />
&nbsp; &nbsp; buttons: true</span></code></pre>

<p>You can even list individual buttons if you don't want to provide access to all of them:</p>

<pre class="highlight "><code><span class="html">fields:<br />
&nbsp; text: <br />
&nbsp; &nbsp; label: Text<br />
&nbsp; &nbsp; type: &nbsp;textarea<br />
&nbsp; &nbsp; size: &nbsp;large<br />
&nbsp; &nbsp; buttons: <br />
&nbsp; &nbsp; &nbsp; - h1<br />
&nbsp; &nbsp; &nbsp; - h2<br />
&nbsp; &nbsp; &nbsp; - bold<br />
&nbsp; &nbsp; &nbsp; - italic</span></code></pre>

<h3>Input validation</h3>

<p>It's now possible to specify required fields and also do some input validation. This is again setup in your blueprints together with field definitions.</p>

<h4>Required fields</h4>

<pre class="highlight "><code><span class="html">fields:<br />
&nbsp; text: <br />
&nbsp; &nbsp; label: &nbsp; &nbsp;Text<br />
&nbsp; &nbsp; type: &nbsp; &nbsp; textarea<br />
&nbsp; &nbsp; size: &nbsp; &nbsp; large<br />
&nbsp; &nbsp; required: true</span></code></pre>

<h4>Validation</h4>

<p>If you want to make sure that the content of a field is validated before a page can be saved, you can use the new validate option for fields.</p>

<pre class="highlight "><code><span class="html">fields:<br />
&nbsp; email: <br />
&nbsp; &nbsp; label: &nbsp; &nbsp;Email Address<br />
&nbsp; &nbsp; type: &nbsp; &nbsp; text<br />
&nbsp; &nbsp; validate: email</span></code></pre>

<p>You can use the predefined validation methods: <code>email</code>, <code>date</code>, <code>url</code> or you can define your own:</p>

<pre class="highlight "><code><span class="html">fields:<br />
&nbsp; somefield: <br />
&nbsp; &nbsp; label: &nbsp;Some Label<br />
&nbsp; &nbsp; type: &nbsp; text<br />
&nbsp; &nbsp; validate: <br />
&nbsp; &nbsp; &nbsp; minlength: 10<br />
&nbsp; &nbsp; &nbsp; maxlength: 30<br />
&nbsp; &nbsp; &nbsp; match: &nbsp; &nbsp; /[a-z0-9]+/i</span></code></pre>

<p>minlengt, maxlength and match are all optional, so you can combine them however you want.</p>

<h3>Running the panel without mod_rewrite</h3>

<p>The requirement for mod&#95;rewrite for the Panel has led to quite some problems, so you can now switch off mod&#95;rewrite support for the Panel in the Panel config (site/panel/config/config.php)</p>

<pre class="highlight php"><code><span class="php">c::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'panel.rewrite'</span>, <span class="kw1">false</span><span class="br0">&#41;</span>;</span></code></pre>

<p>All Panel URLs will be constructed like this afterwards:</p>

<pre class="highlight "><code><span class="html">http://yourdomain.com/panel/index.php/some/path</span></code></pre>

<h3>IE 8 ready!</h3>

<p>The Panel interface will now work 100% on Internet Explorer 8. This will be the oldest supported version of Internet Explorer for Panel Version 1. Depending on the feedback, I might add support for Internet Explorer 7 later. The Panel has also been tested on IE9, latest versions of Opera, Firefox, Safari and Chrome (Win and Mac). If you find any browser-related issues, please let me know.</p>

<p>The Panel works also great on the iPad, except for sorting pages. I plan to add support for MobileSafari on the iPhone + Webkit on Android and sorting without drag and drop later.</p>

<h3>Bug Fixes</h3>

<p>There are tons of bug fixes in this release. Please check the <a href="https://github.com/bastianallgeier/kirbycms-panel/blob/master/changelog.mdown">changelog.mdown</a> for more info.</p>

<h3>Translations</h3>

<p>I'm totally overwhelmed by the fantastic support with translations. The Panel is still in Alpha and yet it is available in <strong>nine languages!!</strong></p>

<p>A huge "Thank You!!" to: <a href="http://morrick.me">Riccardo Mori</a>, <a href="http://www.laggoun.com">Loubna Aggoun</a>, <a href="http://kukac7.hu">D&aacute;vid B&oacute;ta</a>, <a href="http://www.nirusu.me">Nils Hendriks</a>, <a href="http://seitenwerk.at">Seitenwerk</a>, <a href="http://ciuciu.at">Ciuciu</a> and <a href="http://seitenwerk.at">Parlak</a> for their help.</p>

<p>Please check the <a href="http://www.getkirby.com/panel/translations">Translations</a> page for more info. Also, please contact me, if you want to get involved: <a href="&#109;&#97;&#105;&#108;&#x74;&#x6f;&#x3a;&#x62;a&#115;&#116;&#105;&#x61;&#x6e;&#x40;&#x67;e&#116;&#107;&#105;&#114;&#x62;&#x79;&#x2e;&#x63;&#111;&#109;">&#x62;a&#115;&#116;&#105;&#x61;&#x6e;&#x40;&#x67;e&#116;&#107;&#105;&#114;&#x62;&#x79;&#x2e;&#x63;&#111;&#109;</a></p>

<p>To change the Panel translation for a certain account, open the account file in site/panel/accounts and change the language code like this:</p>

<pre class="highlight "><code><span class="html">username: bastian<br />
password: supersecret<br />
language: de</span></code></pre>

<p>Available codes are</p>

<pre class="highlight "><code><span class="html">de = German<br />
en = English<br />
es = Spanish<br />
fr = French<br />
hu = Hungarian<br />
it = Italian<br />
nl = Dutch<br />
ro = Rumanian<br />
tr = Turkish</span></code></pre>

<h2>Next Steps</h2>

<p>It's all about finalizing the latest features now and about fixing the last bugs. So please help me with bug-hunting! Install the latest version and let me know if you find something, which is not working as expected: <a href="&#109;&#97;&#105;&#108;&#x74;&#x6f;&#x3a;&#x62;a&#115;&#116;&#105;&#x61;&#x6e;&#x40;&#x67;e&#116;&#107;&#105;&#114;&#x62;&#x79;&#x2e;&#x63;&#111;&#109;">&#x62;a&#115;&#116;&#105;&#x61;&#x6e;&#x40;&#x67;e&#116;&#107;&#105;&#114;&#x62;&#x79;&#x2e;&#x63;&#111;&#109;</a></p>

<p>You can also use the <a href="https://github.com/bastianallgeier/kirbycms-panel/issues">Github Issue Tracker</a></p>

<h3>Dev Branch</h3>

<p>I'm going to release all future updates until the next release in the <a href="https://github.com/bastianallgeier/kirbycms-panel/tree/dev">dev branch</a>, so please make sure to check changes there from time to time to get the latest version.</p>

<h3>Get Involved</h3>

<p>If you are a developer, you are welcome to get involved in the development directly. Just heck the hell out of the latest version and let me know about it :)</p>

<h3>Thank you!</h3>

<p>This is all off to a fantastic start and it wouldn't be possible without your help – thank you!!</p>

<p>Cheers, Bastian</p>
]]></description>      
            
    </item>
        <item>
      <title>Kirby Toolkit 101</title>  
      <link>http://www.getkirby.com/blog/toolkit-101</link>
      <guid>http://www.getkirby.com/blog/toolkit-101</guid>
      <pubDate>Wed, 11 Apr 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p>As you might already know, Kirby CMS is based on a PHP library called <a href="http://toolkit.getkirby.com">Kirby Toolkit</a></p>

<p>PHP is sometimes so messed up, that you necessarily start to write your own wrappers and helpers, to make your daily work with PHP easier. The Toolkit is a collection of classes and functions, which I came up with in the last years and which have become a core element of my work.</p>

<p>It's a 1-file, open-source library, which can be easily included in any existing project. Since it is already included in the Kirby CMS core, you can start using all its <a href="http://toolkit.getkirby.com/docs">classes and functions</a> right away. If you want to use it for any other project, you can <a href="https://github.com/bastianallgeier/kirby">download the source from Github</a>.</p>

<h2>Philosophy</h2>

<p>The code of the library is quite unorthodox. It uses static methods all over the place to create short memorizable method names and group methods. Either you like it or you don't. But the good thing is, that you don't have to use it, if you don't like it :)</p>

<p>Here are some of the principles the library follows.</p>

<ul>
<li>keep it simple stupid</li>
<li>help to write less code</li>
<li>make things easier to memorize</li>
<li>provide better consistency</li>
<li>provide built-in utf-8 support </li>
<li>keep it focused on core tasks</li>
</ul>

<p><br /></p>

<h2>Toolkit Tidbits</h2>

<h3>Handling Requests</h3>

<p>PHP has the famous <code>$_GET</code> and <code>$_POST</code> variables, which contain the submitted values from POST and GET request – for example from forms. Working with them and checking for submitted values can be quite painful:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$value</span> <span class="kw5">=</span> <span class="br0">&#40;</span><span class="kw1">isset</span><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">'key'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> ? <span class="kw3">trim</span><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">'key'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> : <span class="st0">'default value'</span>;</span></code></pre>

<p>I think we've all seen this kind of code.</p>

<p>With Kirby, you can save a lot of that hassle by simply using the <code>get()</code> function, which works for POST and GET requests and is way more comfortable to use.</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$value</span> <span class="kw5">=</span> get<span class="br0">&#40;</span><span class="st0">'key'</span>, <span class="st0">'default value'</span><span class="br0">&#41;</span>;</span></code></pre>

<p>If you don't pass a default value, false will be returned if nothing could be found for the passed key:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$value</span> <span class="kw5">=</span> get<span class="br0">&#40;</span><span class="st0">'key'</span><span class="br0">&#41;</span>;</span></code></pre>

<p><code>get()</code> will also take care of trimming and of stripping slashes if necessary.</p>

<hr />

<h3>Redirection</h3>

<p>If you want to create a simple redirect, you normally need to send a location header and if you want to do it correctly, you should also send a http status header:</p>

<pre class="highlight php"><code><span class="php"><span class="kw3">header</span><span class="br0">&#40;</span><span class="st0">'HTTP/1.1 301 Moved Permanently'</span><span class="br0">&#41;</span>;<br />
<span class="kw3">header</span><span class="br0">&#40;</span><span class="st0">'Location: http://mywebsite.com'</span><span class="br0">&#41;</span>;</span></code></pre>

<p>With Kirby you can just write…</p>

<pre class="highlight php"><code><span class="php">go<span class="br0">&#40;</span><span class="st0">'http://mywebsite.com'</span><span class="br0">&#41;</span>;</span></code></pre>

<hr />

<h3>Working with arrays</h3>

<h4>a::show</h4>

<p>If you are debugging, you often need to inspect the content of an array or object. There's <code>var_dump</code> or <code>print_r</code>, but their output isn't really nice. <code>a::show()</code> helps you by producing nice, readable output of any array or object:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$array</span> <span class="kw5">=</span> <span class="kw1">array</span><span class="br0">&#40;</span><span class="st0">'design'</span>, <span class="st0">'tags'</span>, <span class="st0">'typography'</span><span class="br0">&#41;</span>;<br />
<br />
a::<span class="me2">show</span><span class="br0">&#40;</span><span class="re0">$array</span><span class="br0">&#41;</span>;<br />
<br />
<span class="coMULTI">/* output:<br />
<br />
Array<br />
(<br />
&nbsp; &nbsp; [0] =&gt; design<br />
&nbsp; &nbsp; [1] =&gt; tags<br />
&nbsp; &nbsp; [2] =&gt; typography<br />
)<br />
<br />
*/</span></span></code></pre>

<hr />

<h4>a::get</h4>

<p>How often do you find yourself writing something like this?</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$value</span> <span class="kw5">=</span> <span class="br0">&#40;</span><span class="kw1">isset</span><span class="br0">&#40;</span><span class="re0">$array</span><span class="br0">&#91;</span><span class="st0">'key'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> ? <span class="re0">$array</span><span class="br0">&#91;</span><span class="st0">'key'</span><span class="br0">&#93;</span> : <span class="st0">'default value'</span>;</span></code></pre>

<p>Instead <code>a::get</code> will try to find a value for a key in an array for you and return either that value or your default value if nothing has been found.</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$value</span> <span class="kw5">=</span> a::<span class="me2">get</span><span class="br0">&#40;</span><span class="re0">$array</span>, <span class="st0">'key'</span>, <span class="st0">'default value'</span><span class="br0">&#41;</span>;</span></code></pre>

<p>If you don't pass a default value and nothing could be found for that key,<br />
<code>false</code> will be returned.</p>

<hr />

<h4>a::first and a::last</h4>

<p>Do you remeber, which was the function name for that array function that returns the first element of an array or that function that returns the last element? <code>array_pop</code>, <code>array_push</code>, <code>array_shift</code>, <code>array_unshift</code>? Maybe it's just me, but those function names kill me.</p>

<p>With Kirby you can do:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$array</span> <span class="kw5">=</span> <span class="kw1">array</span><span class="br0">&#40;</span><span class="st0">'design'</span>, <span class="st0">'tags'</span>, <span class="st0">'typography'</span><span class="br0">&#41;</span>;<br />
<br />
<span class="kw1">echo</span> a::<span class="me2">first</span><span class="br0">&#40;</span><span class="re0">$array</span><span class="br0">&#41;</span>;<br />
<span class="co1">// output: design</span><br />
<br />
<span class="kw1">echo</span> a::<span class="me2">last</span><span class="br0">&#40;</span><span class="re0">$array</span><span class="br0">&#41;</span>;<br />
<span class="co1">// output: typography</span></span></code></pre>

<p>This also works with associative arrays of course.</p>

<hr />

<h4>a::sort</h4>

<p>Sorting a multi-dimensional array is a nightmare – not anymore!</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$array</span> <span class="kw5">=</span> <span class="kw1">array</span><span class="br0">&#40;</span><br />
&nbsp; <span class="kw1">array</span><span class="br0">&#40;</span><span class="st0">'username'</span> =&gt; <span class="st0">'homer'</span><span class="br0">&#41;</span>,<br />
&nbsp; <span class="kw1">array</span><span class="br0">&#40;</span><span class="st0">'username'</span> =&gt; <span class="st0">'marge'</span><span class="br0">&#41;</span>,<br />
&nbsp; <span class="kw1">array</span><span class="br0">&#40;</span><span class="st0">'username'</span> =&gt; <span class="st0">'bart'</span><span class="br0">&#41;</span>,<br />
&nbsp; <span class="kw1">array</span><span class="br0">&#40;</span><span class="st0">'username'</span> =&gt; <span class="st0">'lisa'</span><span class="br0">&#41;</span>,<br />
&nbsp; <span class="kw1">array</span><span class="br0">&#40;</span><span class="st0">'username'</span> =&gt; <span class="st0">'maggie'</span><span class="br0">&#41;</span><br />
<span class="br0">&#41;</span>;<br />
&nbsp; <br />
<span class="re0">$sorted</span> <span class="kw5">=</span> a::<span class="kw3">sort</span><span class="br0">&#40;</span><span class="re0">$array</span>, <span class="st0">'username'</span>, <span class="st0">'asc'</span><span class="br0">&#41;</span>;<br />
<br />
a::<span class="me2">show</span><span class="br0">&#40;</span><span class="re0">$sorted</span><span class="br0">&#41;</span>;<br />
<br />
<span class="coMULTI">/* output:<br />
<br />
Array<br />
(<br />
&nbsp; &nbsp; [0] =&gt; Array<br />
&nbsp; &nbsp; &nbsp; &nbsp; (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [username] =&gt; bart<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
<br />
&nbsp; &nbsp; [1] =&gt; Array<br />
&nbsp; &nbsp; &nbsp; &nbsp; (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [username] =&gt; homer<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
<br />
&nbsp; &nbsp; [2] =&gt; Array<br />
&nbsp; &nbsp; &nbsp; &nbsp; (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [username] =&gt; lisa<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
<br />
&nbsp; &nbsp; [3] =&gt; Array<br />
&nbsp; &nbsp; &nbsp; &nbsp; (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [username] =&gt; maggie<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
<br />
&nbsp; &nbsp; [4] =&gt; Array<br />
&nbsp; &nbsp; &nbsp; &nbsp; (<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [username] =&gt; marge<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
<br />
)<br />
<br />
*/</span></span></code></pre>

<hr />

<h3>Working with strings</h3>

<h4>str::lower and str::upper</h4>

<p>Converting a string to lowercase or uppercase shouldn't be hard, right? Unfortunately PHP's native strtolower and strtoupper functions are not able to handle UTF-8 encoded strings correctly. That's why Kirby has its own lowercase and uppercase functions:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$sometext</span> <span class="kw5">=</span> <span class="st0">'This is a übercool Example of üppercase and Løwercase'</span>;<br />
<br />
<span class="kw1">echo</span> str::<span class="me2">lower</span><span class="br0">&#40;</span><span class="re0">$sometext</span><span class="br0">&#41;</span>;<br />
<span class="co1">// output: this is a übercool example of üppercase and løwercase</span><br />
<br />
<span class="kw1">echo</span> str::<span class="me2">upper</span><span class="br0">&#40;</span><span class="re0">$sometext</span><span class="br0">&#41;</span>;<br />
<span class="co1">// output: THIS IS A ÜBERCOOL EXAMPLE OF ÜPPERCASE AND LØWERCASE</span></span></code></pre>

<hr />

<h4>str::length</h4>

<p>The same problem with UTF-8 exsits for strlen – PHP's native function to count the number of characters in a string. With an UTF-8 encoded string the result wil be wrong. So Kirby has…</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$sometext</span> <span class="kw5">=</span> <span class="st0">'This is a übercool lengthy string'</span>;<br />
<br />
<span class="kw1">echo</span> str::<span class="me2">length</span><span class="br0">&#40;</span><span class="re0">$sometext</span><span class="br0">&#41;</span>;<br />
<span class="co1">// output: 33</span></span></code></pre>

<hr />

<h4>str::short</h4>

<p>To shorten a text is one of the tasks you need all the time. Think of a list of blog articles, with a short excerpt and a "read more" button, or to make sure that user generated content does not break your templates or stuff like that. When shortening strings you most probably want to append an ellipsis to show that it has been shortened, but only if the string is really too long. <code>str::short</code> does exactly that for you…</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$sometext</span> <span class="kw5">=</span> <span class="st0">'This is a übercool lengthy string'</span>;<br />
<br />
<span class="kw1">echo</span> str::<span class="me2">short</span><span class="br0">&#40;</span><span class="re0">$sometext</span>, <span class="nu0">10</span><span class="br0">&#41;</span>;<br />
<span class="co1">// output: This is a…</span></span></code></pre>

<hr />

<h4>str::split</h4>

<p>Splitting strings by a particular character is easy, right? Yep, it is, but it can be even easier. Take a look at the following string.</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$tags</span> <span class="kw5">=</span> <span class="st0">', design, tags, typography, fun, , '</span>;</span></code></pre>

<p>You could use <code>explode(',', $tags)</code> to get all tags, but it wouldn't work well because of spaces and additional commas. <code>str::split</code> will help you to get some nice results without all the mess:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$string</span> <span class="kw5">=</span> <span class="st0">', design, tags, typography, fun, , '</span>;<br />
<span class="re0">$tags</span> &nbsp; <span class="kw5">=</span> str::<span class="kw3">split</span><span class="br0">&#40;</span><span class="re0">$string</span><span class="br0">&#41;</span>;<br />
<br />
a::<span class="me2">show</span><span class="br0">&#40;</span><span class="re0">$tags</span><span class="br0">&#41;</span>;<br />
<br />
<span class="coMULTI">/*<br />
<br />
Array<br />
(<br />
&nbsp; &nbsp; [0] =&gt; design<br />
&nbsp; &nbsp; [1] =&gt; tags<br />
&nbsp; &nbsp; [2] =&gt; typography<br />
&nbsp; &nbsp; [3] =&gt; fun<br />
)<br />
<br />
*/</span></span></code></pre>

<p>Of course it's possible to change the splitting character(s):</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$string</span> <span class="kw5">=</span> <span class="st0">'/ design / tags / typography / fun / / '</span>;<br />
<span class="re0">$tags</span> &nbsp; <span class="kw5">=</span> str::<span class="kw3">split</span><span class="br0">&#40;</span><span class="re0">$string</span>, <span class="st0">'/'</span><span class="br0">&#41;</span>;</span></code></pre>

<p>…and you can even specify the minimum length of included string:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$string</span> <span class="kw5">=</span> <span class="st0">'/ design / tags / typography / fun / / '</span>;<br />
<span class="re0">$tags</span> &nbsp; <span class="kw5">=</span> str::<span class="kw3">split</span><span class="br0">&#40;</span><span class="re0">$string</span>, <span class="st0">'/'</span>, <span class="nu0">4</span><span class="br0">&#41;</span>;<br />
<br />
a::<span class="me2">show</span><span class="br0">&#40;</span><span class="re0">$tags</span><span class="br0">&#41;</span>;<br />
<br />
<span class="coMULTI">/* output:<br />
<br />
Array<br />
(<br />
&nbsp; &nbsp; [0] =&gt; design<br />
&nbsp; &nbsp; [1] =&gt; tags<br />
&nbsp; &nbsp; [2] =&gt; typography<br />
)<br />
<br />
*/</span></span></code></pre>

<hr />

<h3>Config</h3>

<h4>c::set and c::get</h4>

<p>If you need some app-wide configuration variables you can either use constants or you can go for Kirby's config variables. They are accessible everywhere and can be set and overwritten everywhere as well.</p>

<pre class="highlight php"><code><span class="php">c::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'myconfigvar'</span>, <span class="st0">'this is my awesome config value'</span><span class="br0">&#41;</span>;<br />
<br />
<span class="kw2">function</span> foo<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <br />
&nbsp; <span class="kw1">echo</span> c::<span class="me2">get</span><span class="br0">&#40;</span><span class="st0">'myconfigvar'</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="co1">// result: 'this is my awesome config value'</span><br />
&nbsp; <br />
<span class="br0">&#125;</span></span></code></pre>

<p>If you want to check, which config variables have been defined so far, do this:</p>

<pre class="highlight php"><code><span class="php">a::<span class="me2">show</span><span class="br0">&#40;</span>c::<span class="me2">get</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// output: your entire config</span></span></code></pre>

<hr />

<h3>Session</h3>

<h4>s::start</h4>

<p>If you want to avoid errors because you start a session twice accidentally, use <code>s::start()</code> instead of <code>session_start()</code></p>

<pre class="highlight php"><code><span class="php"><span class="kw3">session_start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<br />
s::<span class="me2">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// no problem :)</span></span></code></pre>

<hr />

<h4>s::set and s::get</h4>

<p>Sometimes it's really cool to just have to write less:</p>

<pre class="highlight php"><code><span class="php"><span class="co1">// start a session</span><br />
s::<span class="me2">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<br />
s::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'myvar'</span>, <span class="st0">'my value'</span><span class="br0">&#41;</span>;<br />
<br />
<span class="co1">// later…</span><br />
<span class="kw1">echo</span> s::<span class="me2">get</span><span class="br0">&#40;</span><span class="st0">'myvar'</span><span class="br0">&#41;</span>;<br />
<span class="co1">// result: my value</span></span></code></pre>

<p><code>s::get</code> can also be used with a default value, so if the session variable has not been found, the default value will be returned:</p>

<pre class="highlight php"><code><span class="php"><span class="kw1">echo</span> s::<span class="me2">get</span><span class="br0">&#40;</span><span class="st0">'myvar'</span>, <span class="st0">'my default value'</span><span class="br0">&#41;</span>;</span></code></pre>

<hr />

<h3>Cookies</h3>

<h4>cookie::set and cookie::get</h4>

<p>To make setting and getting values from cookies easier, you can use:</p>

<pre class="highlight php"><code><span class="php">cookie::<span class="me2">set</span><span class="br0">&#40;</span><span class="st0">'mycookie'</span>, <span class="st0">'my cookie value'</span><span class="br0">&#41;</span>;<br />
<br />
<span class="co1">// later…</span><br />
cookie::<span class="me2">get</span><span class="br0">&#40;</span><span class="st0">'mycookie'</span><span class="br0">&#41;</span>;<br />
<span class="co1">// result: my cookie value</span></span></code></pre>

<p>… again, you can define a default value if the cookie could not be found:</p>

<pre class="highlight php"><code><span class="php"><span class="kw1">echo</span> cookie::<span class="me2">get</span><span class="br0">&#40;</span><span class="st0">'mycookie'</span>, <span class="st0">'my default value'</span><span class="br0">&#41;</span>;</span></code></pre>

<hr />

<h4>cookie::remove</h4>

<p>To remove a cookie, use</p>

<pre class="highlight php"><code><span class="php">cookie::<span class="me2">remove</span><span class="br0">&#40;</span><span class="st0">'mycookie'</span><span class="br0">&#41;</span>;</span></code></pre>

<hr />

<h3>Files</h3>

<h4>f::write</h4>

<p><code>f::write</code> offers a fool-proof way of creating files. You can even pass an array and that will automatically be converted to json before.</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$content</span> <span class="kw5">=</span> <span class="st0">'This is some nice content for my file'</span>;<br />
<span class="re0">$file</span> &nbsp; &nbsp;<span class="kw5">=</span> <span class="st0">'/some/path/to/my/file.txt'</span>;<br />
<br />
f::<span class="me2">write</span><span class="br0">&#40;</span><span class="re0">$file</span>, <span class="re0">$content</span><span class="br0">&#41;</span>;</span></code></pre>

<hr />

<h4>f::read</h4>

<p>Reading a file is very simple with PHP <code>file_get_contents</code>, but with <code>f::read()</code>  you get a more consistent and shorter function and you can even use the second argument to instantly parse the result:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$file</span> <span class="kw5">=</span> <span class="st0">'/some/path/to/my/file.txt'</span>;<br />
<br />
<span class="kw1">echo</span> f::<span class="me2">read</span><span class="br0">&#40;</span><span class="re0">$file</span><span class="br0">&#41;</span>;<br />
<span class="co1">// result: content of file.text</span><br />
<br />
<span class="re0">$file</span> <span class="kw5">=</span> <span class="st0">'/some/path/to/my/file.json'</span>;<br />
<br />
<span class="kw1">echo</span> f::<span class="me2">read</span><span class="br0">&#40;</span><span class="re0">$file</span>, <span class="st0">'json'</span><span class="br0">&#41;</span>;<br />
<span class="co1">// result: the parsed json string as array</span></span></code></pre>

<hr />

<h3>Directories</h3>

<h4>dir::read</h4>

<p>Sometimes it's great to be able to get all files in a directory. Kirby CMS is entirely based on that. With <code>dir::read</code> you will get an array with filenames in a passed directory:</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$files</span> <span class="kw5">=</span> <span class="kw3">dir</span>::<span class="me2">read</span><span class="br0">&#40;</span><span class="st0">'/path/to/my/dir'</span><span class="br0">&#41;</span>;<br />
<br />
a::<span class="me2">show</span><span class="br0">&#40;</span><span class="re0">$files</span><span class="br0">&#41;</span>;<br />
<span class="co1">// result: an array with all filenames</span></span></code></pre>

<hr />

<h4>dir::make and dir::remove</h4>

<p><code>dir::make</code> will create a directory if it does not exist yet and<br />
with <code>dir::remove</code> you can delete an entire directory with all its contents.</p>

<pre class="highlight php"><code><span class="php"><span class="kw3">dir</span>::<span class="me2">make</span><span class="br0">&#40;</span><span class="st0">'/path/to/my/new/dir'</span><span class="br0">&#41;</span>;<br />
<br />
<span class="kw3">dir</span>::<span class="me2">remove</span><span class="br0">&#40;</span><span class="st0">'/path/to/my/new/dir'</span><span class="br0">&#41;</span>;</span></code></pre>

<hr />

<h3>Validation</h3>

<h4>v::email</h4>

<p>Check for a valid email address…</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$email</span> <span class="kw5">=</span> <span class="st0">'bastian@getkirby.com'</span>;<br />
<br />
<span class="kw1">if</span><span class="br0">&#40;</span>v::<span class="me2">email</span><span class="br0">&#40;</span><span class="re0">$email</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">echo</span> <span class="st0">'this is a valid email address'</span>; &nbsp;<br />
<span class="br0">&#125;</span></span></code></pre>

<hr />

<h4>v::url</h4>

<p>Check for a valid URL…</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$url</span> <span class="kw5">=</span> <span class="st0">'http://someurl.com'</span>;<br />
<br />
<span class="kw1">if</span><span class="br0">&#40;</span>v::<span class="me2">url</span><span class="br0">&#40;</span><span class="re0">$url</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">echo</span> <span class="st0">'this is a valid url'</span>; &nbsp;<br />
<span class="br0">&#125;</span></span></code></pre>

<hr />

<h4>v::date</h4>

<p>Check any parsable date…</p>

<pre class="highlight php"><code><span class="php"><span class="re0">$date</span> <span class="kw5">=</span> <span class="st0">'11.04.2012'</span>;<br />
<br />
<span class="kw1">if</span><span class="br0">&#40;</span>v::<span class="kw3">date</span><span class="br0">&#40;</span><span class="re0">$date</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">echo</span> <span class="st0">'this is a valid date'</span>; &nbsp;<br />
<span class="br0">&#125;</span></span></code></pre>

<hr />

<h2>More…</h2>

<p>The <a href="http://toolkit.getkirby.com">Kirby Toolkit</a> has way more features. Please <a href="http://toolkit.getkirby.com">read the docs</a> to learn more about them. <br />
There's also a tutorial <a href="http://www.getkirby.com/blog/database">how to use the built-in database class</a>.</p>

<p>If you like the Toolkit, but you want to add your own features, feel free to <a href="https://github.com/bastianallgeier/kirby">fork it on Github</a>.</p>
]]></description>      
            
    </item>
        <item>
      <title>The Reading Time Plugin</title>  
      <link>http://www.getkirby.com/blog/reading-time</link>
      <guid>http://www.getkirby.com/blog/reading-time</guid>
      <pubDate>Tue, 10 Apr 2012 00:00:00 +0000</pubDate>
        
                  <description><![CDATA[<p>Time is precious and sometimes it would be just great to know if it is worth starting to read a blog article right now, or save it for later when you got more time to read it. That's where the new <a href="https://github.com/bastianallgeier/kirbycms-extensions/blob/master/plugins/readingtime">Reading Time Plugin</a> by <a href="http://roylodder.com">Roy Lodder</a> comes in handy.</p>

<p>The Plugin makes it easy to display the estimated time to read any text in Kirby.</p>

<h2>Installation</h2>

<p>The installation is as simple as ever. Download the <a href="https://github.com/bastianallgeier/kirbycms-extensions/blob/master/plugins/readingtime/readingtime.php">readingtime.php</a> and put it in <code>site/plugins</code> Create the plugins folder if it is not there yet.</p>

<h2>Usage</h2>

<p>Once, the plugin is installed, you can instantly use it in your templates like this:</p>

<pre class="highlight "><code><span class="html"><span class="sc2">&lt;article&gt;</span><br />
&nbsp; <span class="sc2"><span class="kw2">&lt;h1&gt;</span></span><span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> html<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">title</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><span class="sc2"><span class="kw2">&lt;/h1&gt;</span></span><br />
&nbsp; <span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">class</span>=<span class="st0">&quot;readingtime&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; Estimated Reading Time: <br />
&nbsp; &nbsp; <span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> readingtime<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">text</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><br />
&nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; <span class="php"><span class="kw4">&lt;?php</span> <span class="kw1">echo</span> kirbytext<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">text</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw4">?&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;</span>/article&gt;</span></span></code></pre>

<h2>Example Output</h2>

<pre><code>Estimated Reading Time: 11 minutes, 31 seconds
</code></pre>

<h2>Localization</h2>

<p>If you need to translate the output to a different language, you can directly do that by passing the following paramaters.</p>

<pre class="highlight php"><code><span class="php"><span class="kw4">&lt;?php</span> <br />
<br />
<span class="kw1">echo</span> readingtime<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">text</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="kw1">array</span><span class="br0">&#40;</span><br />
&nbsp; <span class="st0">'minute'</span> &nbsp;=&gt; <span class="st0">'Minute'</span>,<br />
&nbsp; <span class="st0">'minutes'</span> =&gt; <span class="st0">'Minuten'</span>,<br />
&nbsp; <span class="st0">'second'</span> &nbsp;=&gt; <span class="st0">'Sekunde'</span>,<br />
&nbsp; <span class="st0">'seconds'</span> =&gt; <span class="st0">'Sekunden'</span><br />
<span class="br0">&#41;</span><span class="br0">&#41;</span>; <br />
<br />
<span class="kw4">?&gt;</span></span></code></pre>

<p>You can even change the entire format of the result string:</p>

<pre class="highlight php"><code><span class="php"><span class="kw4">&lt;?php</span> <br />
<br />
<span class="kw1">echo</span> readingtime<span class="br0">&#40;</span><span class="re0">$page</span>-&gt;<span class="me1">text</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="kw1">array</span><span class="br0">&#40;</span><br />
&nbsp; <span class="st0">'minute'</span> &nbsp;=&gt; <span class="st0">'Minute'</span>,<br />
&nbsp; <span class="st0">'minutes'</span> =&gt; <span class="st0">'Minuten'</span>,<br />
&nbsp; <span class="st0">'second'</span> &nbsp;=&gt; <span class="st0">'Sekunde'</span>,<br />
&nbsp; <span class="st0">'seconds'</span> =&gt; <span class="st0">'Sekunden'</span>,<br />
&nbsp; <span class="st0">'format'</span> &nbsp;=&gt; <span class="st0">'{minutesCount} {minutesLabel} – {secondsCount} {secondsLabel}'</span><br />
<span class="br0">&#41;</span><span class="br0">&#41;</span>; <br />
<br />
<span class="kw4">?&gt;</span></span></code></pre>

<p>This makes the plugin very flexible and you gain full control of the generated HTML.</p>

<p>I think it's a fantastic plugin and a great addition to any blog. Thanks to <a href="http://roylodder.com">Roy</a> for his help.</p>
]]></description>      
            
    </item>
            
  </channel>
</rss>
