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

<channel>
	<title>Wikka Developer Blog &#187; Documentation</title>
	<atom:link href="http://blog.wikkawiki.org/category/documentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.wikkawiki.org</link>
	<description>Fresh news from the Wikka Developer Team</description>
	<lastBuildDate>Sun, 11 Dec 2011 15:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>How to design themes for WikkaWiki</title>
		<link>http://blog.wikkawiki.org/2009/09/11/how-to-design-themes-for-wikkawiki/</link>
		<comments>http://blog.wikkawiki.org/2009/09/11/how-to-design-themes-for-wikkawiki/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 22:38:20 +0000</pubDate>
		<dc:creator>Dario</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Support]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[1.2]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.wikkawiki.org/?p=97</guid>
		<description><![CDATA[With the release of version 1.2, we introduced support for 100%-modular themes in WikkaWiki. We believe a wiki engine should not force you to use its default layout: the best wikis are those that can be modified to seamlessly run behind the scenes without betraying their presence or to match the look and feel of [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of version <a href="http://docs.wikkawiki.org/WhatsNew12">1.2</a>, we introduced support for <a href="http://docs.wikkawiki.org/WikkaThemes">100%-modular themes</a> in WikkaWiki. We believe a wiki engine should not force you to use its default layout: the best wikis are those that can be modified to seamlessly run <a href="http://docs.wikkawiki.org/InvisibleWiki">behind the scenes</a> without betraying their presence or to match the <em>look and feel</em> of an existing website.</p>
<p><img alt="mozilla theme screenshot" src="http://docs.wikkawiki.org/images/themes/theme_mozilla.jpg" /><img alt="orange theme screenshot" src="http://docs.wikkawiki.org/images/themes/theme_orange.jpg" /><br />
<img alt="pivwan theme screenshot" src="http://docs.wikkawiki.org/images/themes/theme_pivwan.jpg" /><img alt="bronzino theme screenshot" src="http://docs.wikkawiki.org/images/themes/theme_bronzino.jpg" /></p>
<p>In this post we&#8217;ll guide you through the creation of a custom theme.<br />
<span id="more-97"></span></p>
<h3>Where are my themes</h3>
<p>A Wikka theme is a collection of PHP files, images, stylesheets as well as optional javascript libraries stored in a theme folder. The typical file structure of a theme folder is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">templates/
..mytheme/
....css/
......mytheme.css
....img/
....js/
....footer.php
....header.php</pre></div></div>

<p>Core themes are stored in the <tt>templates/</tt> folder while custom themes can be found (and <a href="http://docs.wikkawiki.org/InstallingPlugins">installed</a>) in <tt>plugins/templates/</tt>. The theme selector in the user settings lists all the core and custom themes installed on a wiki.</p>
<h3>Anatomy of a theme</h3>
<p>The basic elements of a theme are the two files: <tt>header.php</tt> and <tt>footer.php</tt>. These files are used to generate the elements required for the complete XHTML output of a wiki page. </p>
<p>The <a href="http://docs.wikkawiki.org/DefaultLayout">default page output</a> is generated through the following steps:</p>
<ol>
<li><strong>the page header.</strong> <tt>header.php</tt> opens the <tt>&lt;html&gt;</tt> tag, adds all the required page metadata inside the <tt>&lt;head&gt;</tt> element (as well as loading stylesheets, javascript dependencies, favicons etc.), opens the &lt;body&gt;, the global page wrapper (<tt>&lt;div id="page"&gt;</tt>) and displays the actual page header (<tt>&lt;div id="header"&gt;</tt>), i.e. a div that typically contains the wiki name, the name of the current page, an optional logo, and the main navigation links.</li>
<li><strong>the page content.</strong> the main wiki content is then displayed, wrapped in a div called <tt>&lt;div id="content"&gt;</tt> and followed by the comments block (<tt>&lt;div id="comments"&gt;</tt>). Note that the main wiki content is controlled by the active <a href="http://docs.wikkawiki.org/HandlerInfo">handler</a>: by default Wikka calls the <tt>/show</tt> handler but this can vary as a function of the operation (e.g. <tt>/edit</tt>, <tt>/clone</tt>, <tt>/acls</tt> etc.) requested by the user.</li>
<li><strong>the page footer.</strong> <tt>footer.php</tt> finally generates the page footer (<tt>&lt;div id="footer"&gt;</tt>), a div with wiki action links, page information, copyright and license information and validation links; it then closes the page wrapper, the <tt>&lt;body&gt;</tt> and the <tt>&lt;html&gt;</tt> tags. Code required for visitor tracking services (such as Google Analytics) is also typically included in <tt>footer.php</tt></li>
</ol>
<p>It should be noted that a Wikka theme does not need to contain an actual page header or page footer: as long as the necessary XHTML elements are generated and the page layout corresponds to the appropriate selectors in the stylesheet, a theme can use all sort of possible layouts.</p>
<h3>Useful theme methods</h3>
<p>A number of core methods can be useful to dynamically embed content in a theme:</p>
<p><tt><strong>GetThemePath()</strong></tt> can be used to generate URL-rewrite-safe paths to specific theme components (e.g. stylesheets, images, favicons, JS libraries etc.), e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">GetThemePath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/css/wikka.css&quot; /&gt;
&lt;/link&gt;</pre></div></div>

<p><tt><strong>GetMethod()</strong></tt> can be used to test for the active handler, in order to generate output as a function of the currently specified action, e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">GetMethod</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'revisions'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow, noarchive&quot; /&gt;'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><tt><strong>PageTitle()</strong></tt> can be used to display the human-friendly title of the current page (i.e. the content of the highest-level heading, if available), e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">GetWakkaName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">PageTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span></pre></div></div>

<p>The <tt><strong>$page</strong> array can be used to access metadata of the current page, e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">page</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;tag&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'SandBox'</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p> while config settings can be accessed using the </tt><tt><strong>GetConfigValue()</strong></tt> method, e.g.:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">GetConfigValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;hide_comments&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><tt><strong>Href()</strong></tt> can be used to create links to a given wiki page using the specified handler, e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Href</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'revisions.xml'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tag</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/link&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p><tt><strong>MakeMenu()</strong></tt> can be used to generate a menu bar from the specified <a href="http://docs.wikkawiki.org/WikkaMenus">menu template file</a>, e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MakeMenu</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'main_menu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>(we will dedicate another tutorial to menu templates)</p>
<p>Most importantly, you can use the <tt><strong>Action()</strong></tt> method to embed in a theme any of the <a href="http://docs.wikkawiki.org/UsingActions">actions</a> bundled with Wikka or installed in the <tt>plugins/actions/</tt> folder. For example you can embed a Flash object in the page footer via the following line of code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Action</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'flash url=&quot;http://example.com/example.swf&quot; width=&quot;150&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>On top of Wikka&#8217;s internal methods you can obviously use any valid PHP method, e.g. you can display the current date via PHP&#8217;s <tt>date()</tt> function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;left&quot;</span><span style="color: #339933;">&gt;&lt;</span>span <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;noprint&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;l d F Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

<h3>The stylesheet</h3>
<p>To style the output of the page you will need to include with your theme a <strong>stylesheet</strong> with all the CSS selectors that are required to correctly render the template. The best way to make sure all the basic CSS options are included (i.e. those required by the core functionality of the wiki) is to modify the stylesheet included in the &#8220;default&#8221; template: <tt>templates/default/css/wikka.css</tt>. To control the output of Wikka using other kinds of media (e.g. a printer or mobile device) you will need to create and load the respective stylesheets.</p>
<h3>That&#8217;s all folks!</h3>
<p>These are just basic instructions to get you started with the design of a custom theme, further information can be found on the <a href="http://docs.wikkawiki.org">documentation server</a>.</p>
<p>We look forward to seeing your best creations! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wikkawiki.org/2009/09/11/how-to-design-themes-for-wikkawiki/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Wikka in action: 9 screencasts to understand how a wiki works</title>
		<link>http://blog.wikkawiki.org/2007/10/28/wikka-in-action-9-screencasts-to-understand-how-a-wiki-works/</link>
		<comments>http://blog.wikkawiki.org/2007/10/28/wikka-in-action-9-screencasts-to-understand-how-a-wiki-works/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 09:59:45 +0000</pubDate>
		<dc:creator>Dario</dc:creator>
				<category><![CDATA[Demo]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.wikkawiki.org/2007/10/28/wikka-in-action-9-screencasts-to-understand-how-a-wiki-works/</guid>
		<description><![CDATA[If you are new to the concept of a wiki and wish to preview some of the features of WikkaWiki, then these screencasts may be what you are looking for.Nine short QuickTime videoclips introducing the basics of Wikka. From simple tasks such as: creating and editing a page adding links to more advanced ones like: [...]]]></description>
			<content:encoded><![CDATA[<p>If you are new to the concept of a wiki and wish to preview some of the features of WikkaWiki, then these screencasts may be what you are looking for.<br />Nine short QuickTime videoclips introducing the basics of Wikka.</p>
<p> <span id="more-14"></span>
<p>From simple tasks such as:</p>
<ul>
<li><em>creating and editing a page</em></li>
<li><em>adding links</em></li>
</ul>
<p>to more advanced ones like:</p>
<ul>
<li><em>embedding an external feed in a page</em></li>
<li><em>adding a code example</em></li>
<li><em>adding a Flash object to a page</em></li>
</ul>
<p>Check them out: <strong><a href="http://wikkawiki.org/WikkaInAction">Wikka in Action</a></strong></p>
<p><a href='http://wikkawiki.org/WikkaInAction' title='Wikka in Action'><img class="border" src='http://blog.wikkawiki.org/wp-content/uploads/2007/10/wikka_in_action_5.jpg' alt='Wikka in Action' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wikkawiki.org/2007/10/28/wikka-in-action-9-screencasts-to-understand-how-a-wiki-works/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

