<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Pages tagged include or feed</title>
		<link>http://community.wikidot.com</link>
		<description></description>
				<copyright></copyright>
		<lastBuildDate>Fri, 15 May 2026 04:19:11 +0000</lastBuildDate>
		
					<item>
				<guid>http://community.wikidot.com/howto:making-a-custom-table-with-listpages</guid>
				<title>Making a Custom Table with ListPages</title>
				<link>http://community.wikidot.com/howto:making-a-custom-table-with-listpages</link>
				<description>

&lt;p&gt;The &lt;a href=&quot;http://www.wikidot.com/doc:listpages-module&quot; target=&quot;_blank&quot;&gt;ListPages module&lt;/a&gt; is an incredibly powerful tool that easily lists pages according to specific criteria. This is useful for wikis with massive contributions, personal blogs, notebooks, and more. One of the best parts is that the displayed info on each page can be formatted to your tastes. Making the pages display in a customized table, however, can be sort of tricky. In this how-to, we will show you how to quickly make a custom table which displays your pages and their respective info.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/timothy-foster&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=197988&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;Timothy Foster&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=197988)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/timothy-foster&quot;  &gt;Timothy Foster&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 16 Sep 2011 02:08:33 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>The <a href="http://www.wikidot.com/doc:listpages-module" target="_blank">ListPages module</a> is an incredibly powerful tool that easily lists pages according to specific criteria. This is useful for wikis with massive contributions, personal blogs, notebooks, and more. One of the best parts is that the displayed info on each page can be formatted to your tastes. Making the pages display in a customized table, however, can be sort of tricky. In this how-to, we will show you how to quickly make a custom table which displays your pages and their respective info.</p> <h1><span>Understanding prependLine, appendLine, and separate</span></h1> <p>First, you should know about three very special ListPages attributes which makes table creation possible. Those attributes are the <tt>prependLine</tt>, <tt>appendLine</tt>, and <tt>separate</tt>. Simply, <tt>prependLine</tt> defines what content comes before the displayed list. The <tt>appendLine</tt>, in contrast, defines content that comes after the displayed list. These will allow you to open and close tables later in the tutorial.</p> <p>The other attribute is <tt>separate</tt>. By default, when the module lists your pages, the terms are broken up into individual div blocks. This puts spaces in between entries. What you want for a table to display correctly, however, is for those spaces to disappear. Fortunately, applying <tt>separate=&quot;false&quot;</tt> as a criterion will eliminate this mysterious space and hence make tables possible.</p> <p>You can see these three commands in action below:</p> <p>Here is the code:</p> <div class="code"> <pre><code>[[module ListPages category=&quot;howto&quot; limit=&quot;5&quot; prependLine=&quot;How Tos&quot; appendLine=&quot;There are more...&quot; separate=&quot;false&quot;]] * %%title_linked%% [[/module]]</code></pre></div> <h1><span>The Simple Table</span></h1> <p>Before going on to complex tables, let's try to understand how this works. Pretend that we have three how-tos to list, and we want them displayed in a table like the below:</p> <table class="wiki-content-table"> <tr> <th>Title</th> <th>Author</th> <th>Age</th> </tr> <tr> <td>Title 1</td> <td>Author</td> <td>Age</td> </tr> <tr> <td>Title 2</td> <td>Author</td> <td>Age</td> </tr> <tr> <td>Title 3</td> <td>Author</td> <td>Age</td> </tr> </table> <p>This is called a <strong>simple table</strong>, since it uses the simple table syntax (see <a href="http://www.wikidot.com/doc:wiki-syntax#toc34" target="_blank">simple tables</a>). And interestingly, they are simple to construct with ListPages. The headings can be defined in the <tt>prependLine</tt> section of the attributes. Since simple tables do not need to be closed, <tt>appendLine</tt> for now will sit out. The <tt>separate=&quot;false&quot;</tt>, however, is a must!</p> <p>The following code will do the trick:</p> <div class="code"> <pre><code>[[module ListPages category=&quot;howto&quot; limit=&quot;3&quot; prependLine=&quot;||~ Title||~ Author||~ Age||&quot; separate=&quot;false&quot;]] ||%%title_linked%%||%%created_by%%||%%created_at|%O old%%|| [[/module]]</code></pre></div> <p>This will generate a table, shown below:</p> <p>Hopefully you can see that table creation in ListPages is not terribly difficult. However, the goal is to make a customized table where you can define things like width and color. Let's see how to do that.</p> <h1><span>Custom Tables at Last</span></h1> <p>Let's begin with the end in mind. We want a table using ListPages that looks like this:</p> <p>So, using the above knowledge on ListPages, its attributes, and simple table creation, let's find a way to make this work.</p> <h2><span>Step 1: Make an Include</span></h2> <p>First, you need to make an incomplete table. That's right: incomplete. When we stick it into the ListPages module, the module will complete the table for us, so for now, we want to make just <em>part</em> of the table, namely the headings.</p> <p>Make a separate page and title it whatever you want. For this tutorial, we'll call this page <tt>inc:custom-table</tt>. On this page, you are going to make the first row of the table, which constitutes the headings. When you are making this table, <em>do not close the table</em>. Essentially, what you will have is an opened table with a full row, like the below:</p> <div class="code"> <pre><code>[[table style=&quot;width: 100%;&quot;]][[row style=&quot;font-weight: bold; background-color: #B8D1DD;&quot;]][[cell style=&quot;padding: 0 2px; width: 50%;&quot;]]Title[[/cell]][[cell style=&quot;padding: 0 2px; width: 25%; text-align: center;&quot;]]Author[[/cell]][[cell style=&quot;padding: 0 2px; text-align: right;&quot;]]Age[[/cell]][[/row]]</code></pre></div> <p>We closed the row, but not the table. Save that page and remember the page name.</p> <h2><span>Step 2: Define prependLine</span></h2> <p>Now, we are going to install this heading into the ListPages using <tt>prependLine</tt>.</p> <p>Wait a minute&#8230; why did we make a separate page for this? Could we have just opened the table by directly putting the code into <tt>prependLine</tt>? The answer is no, unless you have no styling or classes. When you define your table and then additionally define a style, you are using quotes (&quot;&quot;). ListPages uses these same quotes! Therefore, the module might confuse the beginning of a style statement with the end of an attribute definition. Therefore, making that separate page was entirely necessary.</p> <p>Here is what you do: put this into the <tt>prependLine</tt>.</p> <div class="code"> <pre><code>prependLine=&quot;[[include inc:custom-table]]&quot;</code></pre></div> <p><strong>Note:</strong> Replace <tt>inc:custom-table</tt> with the page name (in the URL) of the page you created in step 1.</p> <p>This way, ListPages will insert your heading without the interference additional quotes might pose.</p> <h2><span>Step 3: Define appendLine and separate</span></h2> <p>This is easier. Place the following into your list of ListPages criteria:</p> <div class="code"> <pre><code>appendLine=&quot;[[/table]]&quot; separate=&quot;false&quot;</code></pre></div> <h2><span>Step 4: Define the Body</span></h2> <p>Now for the meat of the table. In the simple table example, you saw how we used the simple table syntax between the [[module]][[/module]] tags to help construct a table. If we are using a custom table, we are going to use the custom table syntax.</p> <p>Each item will be its own row, so the &quot;sandwiched&quot; part will have a single [[row]] and [[/row]], with cells in between corresponding to the headings. You can style this however you wish. Just make sure your headings and body match!</p> <p>Here is the code we used above for the table:</p> <div class="code"> <pre><code>[[row]][[cell style=&quot;vertical-align: top;&quot;]]**%%title_linked%%**[[/cell]][[cell style=&quot;vertical-align: top; text-align: center;&quot;]]%%created_by%%[[/cell]][[cell style=&quot;vertical-align: top; text-align: right;&quot;]]%%created_at|%O old%%[[/cell]][[/row]]</code></pre></div> <h2><span>Step 5: Admire your Handiwork</span></h2> <p>After that, you are done! You can double check that the table looks the way you want and tweak it if it needs improvement. You can furthermore add embellishments and other styling, such as the <a href="http://snippets.wikidot.com/code:table-alterations" target="_blank">Table Alterations</a> snippet which will help you alternate row colors.</p> <p>Here is the overall code that we used for the table:</p> <div class="code"> <pre><code>[[module ListPages category=&quot;howto&quot; limit=&quot;5&quot; prependLine=&quot;[[include inc:custom-table]]&quot; appendLine=&quot;[[/table]]&quot; separate=&quot;false&quot;]] [[row]][[cell style=&quot;vertical-align: top;&quot;]]**%%title_linked%%**[[/cell]][[cell style=&quot;vertical-align: top; text-align: center;&quot;]]%%created_by%%[[/cell]][[cell style=&quot;vertical-align: top; text-align: right;&quot;]]%%created_at|%O old%%[[/cell]][[/row]] [[/module]]</code></pre></div> <h1><span>Additional Help</span></h1> <p>If you have any questions, be sure to ask on the <strong><a href="http://community.wikidot.com/forum:start">forums</a></strong>.</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/timothy-foster" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=197988&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="Timothy Foster" style="background-image:url(http://www.wikidot.com/userkarma.php?u=197988)" /></a><a href="http://www.wikidot.com/user:info/timothy-foster" >Timothy Foster</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:wikidot-includes:techniques</guid>
				<title>Wikidot Include Techniques</title>
				<link>http://community.wikidot.com/howto:wikidot-includes:techniques</link>
				<description>

&lt;p&gt;&lt;em&gt;This guide complements the two HowTos: &lt;a href=&quot;http://community.wikidot.com/howto:wikidot-includes:for-beginners&quot;&gt;Wikidot Includes for Beginners&lt;/a&gt; and &lt;a href=&quot;http://community.wikidot.com/howto:wikidot-includes:for-experts&quot;&gt;Wikidot Includes for Experts&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/govegan&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=35113&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;GoVegan&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=35113)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/govegan&quot;  &gt;GoVegan&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 09 Apr 2010 00:31:03 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p><em>This guide complements the two HowTos: <a href="http://community.wikidot.com/howto:wikidot-includes:for-beginners">Wikidot Includes for Beginners</a> and <a href="http://community.wikidot.com/howto:wikidot-includes:for-experts">Wikidot Includes for Experts</a>.</em></p> <p>Here we will show you how advanced include techniques can be used to automate tasks and create frameworks for Wikidot programs.</p> <table style="margin:0; padding:0"> <tr> <td style="margin:0; padding:0"> <div id="toc"> <div id="toc-action-bar"><a href="javascript:;" >Fold</a><a style="display: none" href="javascript:;" >Unfold</a></div> <div class="title">Table of Contents</div> <div id="toc-list"> <div style="margin-left: 2em;"><a href="#toc0">Default Values</a></div> <div style="margin-left: 2em;"><a href="#toc1">Related Articles</a></div> <div style="margin-left: 2em;"><a href="#toc2">Authors</a></div> </div> </div> </td> </tr> </table> <h2><span>Default Values</span></h2> <p>With the utilization of two include pages, one can allow certain variables to retain default values if they are not defined. Recall in the very first example what happened whenever <tt>varC</tt> wasn't defined:</p> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code>[[include inc:advanced |varA=Banana |varB=Split ]]</code></pre></div> <br /> The result is the following: <table class="wiki-content-table"> <tr> <td> <p>Banana Split {$varC}</p> </td> </tr> </table> <p>Notice how we get an ugly variable in the expressed page since we didn't define what it was. So, let's say that rather than having this weird variable show up, we want for <tt><span style="white-space: pre-wrap;">**James!**</span></tt> (which renders as <strong>James!</strong>) to replace the <tt>varC</tt> <em>if</em> it isn't defined by the user. However, if defined, we want the defined version to appear in precedence.</p> <p>This is fortunately possible with the aid of two includes. For this, we will use the typical <tt>inc:advanced</tt> plus a new page called <tt>inc:advanced-4</tt> with the following on it:</p> <div class="code"> <pre><code>[[include inc:advanced |varA={$varA} |varB={$varB} |varC={$varC} |varC=**James!** ]]</code></pre></div> <p>Now we will use the above original include without <tt>varC</tt> clearly defined and track what is happening:</p> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced<span style="color: #f00">-4</span></tt></strong></td> <td> <p>[[include inc:advanced |varA={$varA} |varB={$varB} |varC={$varC} |varC=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> <tr> <td>|varA=Banana</td> <td> <p>[[include inc:advanced |varA=Banana |varB={$varB} |varC={$varC} |varC=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> <tr> <td>|varB=Split,</td> <td> <p>[[include inc:advanced |varA=Banana |varB=Split, |varC={$varC} |varC=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> </table> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td>|varA=Banana</td> <td> <p>Banana {$varB} {$varC}</p> </td> </tr> <tr> <td>|varB=Split,</td> <td> <p>Banana Split, {$varC}</p> </td> </tr> <tr> <td>|varC={$varC}</td> <td> <p>Banana Split, {$varC}</p> </td> </tr> <tr> <td>|varC=<span style="white-space: pre-wrap;">**James!**</span></td> <td> <p>Banana Split, <strong>James!</strong></p> </td> </tr> </table> <p>And behold, we didn't define <tt>varC</tt> yet <strong>James!</strong> appears! But what if we wanted to define <tt>varC</tt> as &quot;yum!&quot;?</p> <p>We'll examine this code:</p> <div class="code"> <pre><code>[[include inc:advanced-4 |varA=Banana |varB=Split, |varC=yum! ]]</code></pre></div> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced<span style="color: #f00">-4</span></tt></strong></td> <td> <p>[[include inc:advanced |varA={$varA} |varB={$varB} |varC={$varC} |varC=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> <tr> <td>|varA=Banana</td> <td> <p>[[include inc:advanced |varA=Banana |varB={$varB} |varC={$varC} |varC=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> <tr> <td>|varB=Split,</td> <td> <p>[[include inc:advanced |varA=Banana |varB=Split, |varC={$varC} |varC=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> <tr> <td>|varC=yum!</td> <td> <p>[[include inc:advanced |varA=Banana |varB=Split, |varC=yum! |varC=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> </table> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td>|varA=Banana</td> <td> <p>Banana {$varB} {$varC}</p> </td> </tr> <tr> <td>|varB=Split,</td> <td> <p>Banana Split, {$varC}</p> </td> </tr> <tr> <td>|varC=yum!</td> <td> <p>Banana Split, yum!</p> </td> </tr> <tr> <td>|varC=<span style="white-space: pre-wrap;">**James!**</span></td> <td> <p>Banana Split, yum!</p> </td> </tr> </table> <p>Since the code is rendered top to bottom. left to right and variables are replaced before the next is processed, <tt>varC=<span style="white-space: pre-wrap;">**James!**</span></tt> wasn't able to replace a <tt>varC</tt> since it didn't exist after it was defined. The final note to make is that you can set default values for the other variables as well if wished.</p> <p>For a simplified guide to default values, see <a href="http://community.wikidot.com/howto:include-with-defaults">Include with Defaults</a>.</p> <h2><span>Related Articles</span></h2> <ul> <li><a href="http://community.wikidot.com/howto:wikidot-includes:for-beginners">Wikidot Includes: For Beginners</a></li> <li><a href="http://community.wikidot.com/howto:wikidot-includes:for-experts">Wikidot Includes: For Experts</a></li> </ul> <h2><span>Authors</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/james-kanjo" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7932347&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="James Kanjo" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7932347)" /></a><a href="http://www.wikidot.com/user:info/james-kanjo" >James Kanjo</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:james-kanjo">userPage</a>.</span></p> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/timothy-foster" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=197988&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="Timothy Foster" style="background-image:url(http://www.wikidot.com/userkarma.php?u=197988)" /></a><a href="http://www.wikidot.com/user:info/timothy-foster" >Timothy Foster</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:timothy-foster">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/govegan" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=35113&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="GoVegan" style="background-image:url(http://www.wikidot.com/userkarma.php?u=35113)" /></a><a href="http://www.wikidot.com/user:info/govegan" >GoVegan</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:wikidot-includes:for-experts</guid>
				<title>Wikidot Includes: For Experts</title>
				<link>http://community.wikidot.com/howto:wikidot-includes:for-experts</link>
				<description>


&lt;p&gt;Through understanding how the Wikidot engine processes includes, we are able to create highly sophisticated elements of code:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Imports the page specified&lt;/li&gt;
&lt;li&gt;Replaces Variables in the included page only, according to the the definitions in the &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include]]&lt;/span&gt; block in the order:
&lt;ul&gt;
&lt;li&gt;From left-to-right&lt;/li&gt;
&lt;li&gt;From top-to-bottom&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is difficult to grasp at first, so lets put this into practice.&lt;/p&gt;
&lt;table style=&quot;margin:0; padding:0&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;margin:0; padding:0&quot;&gt;
&lt;div id=&quot;toc&quot;&gt;
&lt;div id=&quot;toc-action-bar&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;Fold&lt;/a&gt;&lt;a style=&quot;display: none&quot; href=&quot;javascript:;&quot;  &gt;Unfold&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;title&quot;&gt;Table of Contents&lt;/div&gt;
&lt;div id=&quot;toc-list&quot;&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc0&quot;&gt;Ordering of Processes&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc1&quot;&gt;Temporary Variables&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc2&quot;&gt;Reusing Variables&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc3&quot;&gt;Including an Include&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc4&quot;&gt;Creating Variables with Variables&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc5&quot;&gt;What Won&#039;t Work&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc6&quot;&gt;Related Articles&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc7&quot;&gt;Authors&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h2&gt;&lt;span&gt;Ordering of Processes&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;vertical-align: top; border-left: 2px dashed #000; padding-left: .5em;&quot;&gt;
&lt;h3&gt;&lt;span&gt;inc:advanced&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;{$varA} {$varB} {$varC}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Our Page:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include inc:advanced
|varA=Banana
|varB=Split
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So the first thing that the Wikidot engine will do is import the page &lt;tt&gt;inc:advanced&lt;/tt&gt; then assign values to the Variables, in the order of left-to-right, top-to-bottom.&lt;/p&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$varA} {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varA=Banana&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varB=Split&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana Split {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;Now lets see what happens if we place everything on one line:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Our Page:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include inc:advanced |varA=Banana |varB=Split]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$varA} {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varA=Banana&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varB=Split&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana Split {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;The same results.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Temporary Variables&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Because of the way the Wikidot engine processes includes, we can actually create our own Temporary Variables within the include code:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Our Page:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include inc:advanced
|varA=Banana
|varB={$varTemp}
|varTemp=Split
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$varA} {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varA=Banana&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varB={$varTemp}&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana {$varTemp} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varTemp=Split&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana Split {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;This works because the includes are processed from left-to-right, top-to-bottom, and each variable is replaced in the page before the next variable is processed.&lt;br /&gt;
Therefore, the order in which we place our code is VERY important. For example, if we swapped the last two lines around:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Our Page:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include inc:advanced
|varA=Banana
|varTemp=Split
|varB={$varTemp}
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$varA} {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varA=Banana&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varTemp=Split&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana {$varB} {$varC}&lt;sup class=&quot;footnoteref&quot;&gt;&lt;a id=&quot;footnoteref-72653-1&quot; href=&quot;javascript:;&quot; class=&quot;footnoteref&quot;  &gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varB={$varTemp}&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Banana {$varTemp} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;As you can see, by changing the ordering of our code, we have changed the way our Include Variables are assigned.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Reusing Variables&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;We can also reuse variables in this manner:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Our Page:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include inc:advanced
|varA={$varTemp}
|varTemp=Go
|varB={$varTemp}
|varTemp=Bananas
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$varA} {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varA={$varTemp}&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$varTemp} {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varTemp=Go&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varB={$varTemp}&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go {$varTemp} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varTemp=Bananas&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go Bananas {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h2&gt;&lt;span&gt;Including an Include&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Through using two includes, we are able to use the value of one variable to set the value of another.&lt;/p&gt;
&lt;div style=&quot;vertical-align: top; border-left: 2px dashed #000; padding-left: .5em;&quot;&gt;
&lt;h3&gt;&lt;span&gt;inc:advanced-2&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include inc:advanced
|varA={$varA} |varB={$varB} |{$varTemp}=**James!**
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Our Page:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include inc:advanced-2
|varA=Go
|varB=Bananas
|varTemp=varC
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced&lt;span style=&quot;color: #f00&quot;&gt;-2&lt;/span&gt;&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;[[include inc:advanced |varA={$varA} |varB={$varB} |{$varTemp}=&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;**James!**&lt;/span&gt;]]&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varA=Go&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;[[include inc:advanced |varA=Go |varB={$varB} |{$varTemp}=&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;**James!**&lt;/span&gt;]]&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varB=Bananas&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;[[include inc:advanced |varA=Go |varB=Bananas |{$varTemp}=&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;**James!**&lt;/span&gt;]]&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varTemp=varC&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;[[include inc:advanced |varA=Go |varB=Bananas |varC=&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;**James!**&lt;/span&gt;]]&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$varA} {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varA=Go&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varB=Bananas&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go Bananas {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varC=&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;**James!**&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go Bananas &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;**James!**&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go Bananas &lt;strong&gt;James!&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h2&gt;&lt;span&gt;Creating Variables with Variables&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;We can even build variable names from separate parts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;inc:advanced-3:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;{${$varA}{$varD}
{$varB}Apples}
{$Eat{$varC}}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Our Page:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt; [[include inc:advanced-3 |varA=Go |varB={$Buy |varC=Bananas |varD=Potty} |EatBananas=Eating Bananas  ]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced-3&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{${$varA}{$varD}&lt;br /&gt;
{$varB}Apples}&lt;br /&gt;
{$Eat{$varC}}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varA=Go&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$Go{$varD}&lt;br /&gt;
{$varB}Apples}&lt;br /&gt;
{$Eat{$varC}}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varB={$Buy&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$Go{$varD}&lt;br /&gt;
{$BuyApples}&lt;br /&gt;
{$Eat{$varC}}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varC=Bananas&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$Go{$varD}&lt;br /&gt;
{$BuyApples}&lt;br /&gt;
{$EatBananas}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varD=Potty}&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$GoPotty}&lt;br /&gt;
{$BuyApples}&lt;br /&gt;
{$EatBananas}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|EatBananas=Eating Bananas&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$GoPotty}&lt;br /&gt;
{$BuyApples}&lt;br /&gt;
Eating Bananas&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h2&gt;&lt;span&gt;What Won&#039;t Work&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Setting a variable doesn&#039;t change variables within the include code. Therefore, if we attempted the following code:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Our Page:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include inc:advanced
|varA=Go
|varB=Bananas
|varTemp=varC
|{$varTemp}=James!
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr style=&quot;background-color: #EEE;&quot;&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Rendered Code&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Import &lt;strong&gt;&lt;tt&gt;inc:advanced&lt;/tt&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;{$varA} {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|varA=Go&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go {$varB} {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varB=Bananas&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go Bananas {$varC}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|varTemp=varC&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go Bananas {$varC}&lt;sup class=&quot;footnoteref&quot;&gt;&lt;a id=&quot;footnoteref-72653-2&quot; href=&quot;javascript:;&quot; class=&quot;footnoteref&quot;  &gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;|{$varTemp}=James!&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;Go Bananas {$varC}&lt;sup class=&quot;footnoteref&quot;&gt;&lt;a id=&quot;footnoteref-72653-3&quot; href=&quot;javascript:;&quot; class=&quot;footnoteref&quot;  &gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;What we wanted to happen is for {$varTemp} to become &lt;tt&gt;varC&lt;/tt&gt;, so that &lt;tt&gt;|varC=James!&lt;/tt&gt;.&lt;br /&gt;
This doesn&#039;t work, because&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&amp;#32;[[include]]&lt;/span&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Replaces Variables &lt;strong&gt;in the included page only&lt;/strong&gt;, according to the the definitions in the &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include]]&lt;/span&gt; block&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;footnotes-footer&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Notes&lt;/div&gt;
&lt;div class=&quot;footnote-footer&quot; id=&quot;footnote-72653-1&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;1&lt;/a&gt;. There is no {$varTemp} in the included page at this moment, and so no changes are made to the included text.&lt;/div&gt;
&lt;div class=&quot;footnote-footer&quot; id=&quot;footnote-72653-2&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;2&lt;/a&gt;. Nothing changes because there is no variable {$varTemp} in the included page.&lt;/div&gt;
&lt;div class=&quot;footnote-footer&quot; id=&quot;footnote-72653-3&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;3&lt;/a&gt;. Nothing changes because there is no variable {${$varTemp}} (whatever that might mean) in the included page.&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;&lt;span&gt;Related Articles&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://community.wikidot.com/howto:wikidot-includes:for-beginners&quot;&gt;Wikidot Includes: For Beginners&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://community.wikidot.com/howto:wikidot-includes:techniques&quot;&gt;Wikidot Include Techniques&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span&gt;Authors&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/james-kanjo&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7932347&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;James Kanjo&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7932347)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/james-kanjo&quot;  &gt;James Kanjo&lt;/a&gt;&lt;/span&gt;. &lt;span style=&quot;font-size:smaller;&quot;&gt;Please visit his/her &lt;a href=&quot;http://community.wikidot.com/user:james-kanjo&quot;&gt;userPage&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;error-inline&quot;&gt;&lt;em&gt;rurwin&lt;/em&gt; does not match any existing user name&lt;/span&gt;. &lt;span style=&quot;font-size:smaller;&quot;&gt;Please visit his/her &lt;a class=&quot;newpage&quot; href=&quot;http://community.wikidot.com/user:rurwin&quot;&gt;userPage&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Comments&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/govegan&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=35113&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;GoVegan&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=35113)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/govegan&quot;  &gt;GoVegan&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 18 Mar 2010 23:45:32 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Through understanding how the Wikidot engine processes includes, we are able to create highly sophisticated elements of code:</p> <ol> <li>Imports the page specified</li> <li>Replaces Variables in the included page only, according to the the definitions in the <span style="white-space: pre-wrap;">[[include]]</span> block in the order: <ul> <li>From left-to-right</li> <li>From top-to-bottom</li> </ul> </li> </ol> <p>This is difficult to grasp at first, so lets put this into practice.</p> <table style="margin:0; padding:0"> <tr> <td style="margin:0; padding:0"> <div id="toc"> <div id="toc-action-bar"><a href="javascript:;" >Fold</a><a style="display: none" href="javascript:;" >Unfold</a></div> <div class="title">Table of Contents</div> <div id="toc-list"> <div style="margin-left: 2em;"><a href="#toc0">Ordering of Processes</a></div> <div style="margin-left: 2em;"><a href="#toc1">Temporary Variables</a></div> <div style="margin-left: 2em;"><a href="#toc2">Reusing Variables</a></div> <div style="margin-left: 2em;"><a href="#toc3">Including an Include</a></div> <div style="margin-left: 2em;"><a href="#toc4">Creating Variables with Variables</a></div> <div style="margin-left: 2em;"><a href="#toc5">What Won't Work</a></div> <div style="margin-left: 2em;"><a href="#toc6">Related Articles</a></div> <div style="margin-left: 2em;"><a href="#toc7">Authors</a></div> </div> </div> </td> </tr> </table> <h2><span>Ordering of Processes</span></h2> <div style="vertical-align: top; border-left: 2px dashed #000; padding-left: .5em;"> <h3><span>inc:advanced</span></h3> <div class="code"> <pre><code>{$varA} {$varB} {$varC}</code></pre></div> </div> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code>[[include inc:advanced |varA=Banana |varB=Split ]]</code></pre></div> <p>So the first thing that the Wikidot engine will do is import the page <tt>inc:advanced</tt> then assign values to the Variables, in the order of left-to-right, top-to-bottom.</p> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td>|varA=Banana</td> <td> <p>Banana {$varB} {$varC}</p> </td> </tr> <tr> <td>|varB=Split</td> <td> <p>Banana Split {$varC}</p> </td> </tr> </table> <p>Now lets see what happens if we place everything on one line:</p> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code>[[include inc:advanced |varA=Banana |varB=Split]]</code></pre></div> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td>|varA=Banana</td> <td> <p>Banana {$varB} {$varC}</p> </td> </tr> <tr> <td>|varB=Split</td> <td> <p>Banana Split {$varC}</p> </td> </tr> </table> <p>The same results.</p> <h2><span>Temporary Variables</span></h2> <p>Because of the way the Wikidot engine processes includes, we can actually create our own Temporary Variables within the include code:</p> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code>[[include inc:advanced |varA=Banana |varB={$varTemp} |varTemp=Split ]]</code></pre></div> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td>|varA=Banana</td> <td> <p>Banana {$varB} {$varC}</p> </td> </tr> <tr> <td>|varB={$varTemp}</td> <td> <p>Banana {$varTemp} {$varC}</p> </td> </tr> <tr> <td>|varTemp=Split</td> <td> <p>Banana Split {$varC}</p> </td> </tr> </table> <p>This works because the includes are processed from left-to-right, top-to-bottom, and each variable is replaced in the page before the next variable is processed.<br /> Therefore, the order in which we place our code is VERY important. For example, if we swapped the last two lines around:</p> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code>[[include inc:advanced |varA=Banana |varTemp=Split |varB={$varTemp} ]]</code></pre></div> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td>|varA=Banana</td> <td> <p>Banana {$varB} {$varC}</p> </td> </tr> <tr> <td>|varTemp=Split</td> <td> <p>Banana {$varB} {$varC}<sup class="footnoteref"><a id="footnoteref-648979-1" href="javascript:;" class="footnoteref" >1</a></sup></p> </td> </tr> <tr> <td>|varB={$varTemp}</td> <td> <p>Banana {$varTemp} {$varC}</p> </td> </tr> </table> <p>As you can see, by changing the ordering of our code, we have changed the way our Include Variables are assigned.</p> <h2><span>Reusing Variables</span></h2> <p>We can also reuse variables in this manner:</p> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code>[[include inc:advanced |varA={$varTemp} |varTemp=Go |varB={$varTemp} |varTemp=Bananas ]]</code></pre></div> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td>|varA={$varTemp}</td> <td> <p>{$varTemp} {$varB} {$varC}</p> </td> </tr> <tr> <td> <p>|varTemp=Go</p> </td> <td> <p>Go {$varB} {$varC}</p> </td> </tr> <tr> <td> <p>|varB={$varTemp}</p> </td> <td> <p>Go {$varTemp} {$varC}</p> </td> </tr> <tr> <td> <p>|varTemp=Bananas</p> </td> <td> <p>Go Bananas {$varC}</p> </td> </tr> </table> <h2><span>Including an Include</span></h2> <p>Through using two includes, we are able to use the value of one variable to set the value of another.</p> <div style="vertical-align: top; border-left: 2px dashed #000; padding-left: .5em;"> <h3><span>inc:advanced-2</span></h3> <div class="code"> <pre><code>[[include inc:advanced |varA={$varA} |varB={$varB} |{$varTemp}=**James!** ]]</code></pre></div> </div> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code>[[include inc:advanced-2 |varA=Go |varB=Bananas |varTemp=varC ]]</code></pre></div> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced<span style="color: #f00">-2</span></tt></strong></td> <td> <p>[[include inc:advanced |varA={$varA} |varB={$varB} |{$varTemp}=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> <tr> <td> <p>|varA=Go</p> </td> <td> <p>[[include inc:advanced |varA=Go |varB={$varB} |{$varTemp}=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> <tr> <td> <p>|varB=Bananas</p> </td> <td> <p>[[include inc:advanced |varA=Go |varB=Bananas |{$varTemp}=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> <tr> <td> <p>|varTemp=varC</p> </td> <td> <p>[[include inc:advanced |varA=Go |varB=Bananas |varC=<span style="white-space: pre-wrap;">**James!**</span>]]</p> </td> </tr> </table> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td> <p>|varA=Go</p> </td> <td> <p>Go {$varB} {$varC}</p> </td> </tr> <tr> <td> <p>|varB=Bananas</p> </td> <td> <p>Go Bananas {$varC}</p> </td> </tr> <tr> <td> <p>|varC=<span style="white-space: pre-wrap;">**James!**</span></p> </td> <td> <p>Go Bananas <span style="white-space: pre-wrap;">**James!**</span></p> </td> </tr> <tr> <td></td> <td> <p>Go Bananas <strong>James!</strong></p> </td> </tr> </table> <h2><span>Creating Variables with Variables</span></h2> <p>We can even build variable names from separate parts.</p> <p><strong>inc:advanced-3:</strong></p> <div class="code"> <pre><code>{${$varA}{$varD} {$varB}Apples} {$Eat{$varC}}</code></pre></div> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code> [[include inc:advanced-3 |varA=Go |varB={$Buy |varC=Bananas |varD=Potty} |EatBananas=Eating Bananas ]]</code></pre></div> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced-3</tt></strong></td> <td> <p>{${$varA}{$varD}<br /> {$varB}Apples}<br /> {$Eat{$varC}}</p> </td> </tr> <tr> <td> <p>|varA=Go</p> </td> <td> <p>{$Go{$varD}<br /> {$varB}Apples}<br /> {$Eat{$varC}}</p> </td> </tr> <tr> <td> <p>|varB={$Buy</p> </td> <td> <p>{$Go{$varD}<br /> {$BuyApples}<br /> {$Eat{$varC}}</p> </td> </tr> <tr> <td> <p>|varC=Bananas</p> </td> <td> <p>{$Go{$varD}<br /> {$BuyApples}<br /> {$EatBananas}</p> </td> </tr> <tr> <td> <p>|varD=Potty}</p> </td> <td> <p>{$GoPotty}<br /> {$BuyApples}<br /> {$EatBananas}</p> </td> </tr> <tr> <td> <p>|EatBananas=Eating Bananas</p> </td> <td> <p>{$GoPotty}<br /> {$BuyApples}<br /> Eating Bananas</p> </td> </tr> </table> <h2><span>What Won't Work</span></h2> <p>Setting a variable doesn't change variables within the include code. Therefore, if we attempted the following code:</p> <p><strong>Our Page:</strong></p> <div class="code"> <pre><code>[[include inc:advanced |varA=Go |varB=Bananas |varTemp=varC |{$varTemp}=James! ]]</code></pre></div> <table class="wiki-content-table"> <tr style="background-color: #EEE;"> <td style="text-align: center;"><strong>Step</strong></td> <td style="text-align: center;"><strong>Rendered Code</strong></td> </tr> <tr> <td>Import <strong><tt>inc:advanced</tt></strong></td> <td> <p>{$varA} {$varB} {$varC}</p> </td> </tr> <tr> <td>|varA=Go</td> <td> <p>Go {$varB} {$varC}</p> </td> </tr> <tr> <td> <p>|varB=Bananas</p> </td> <td> <p>Go Bananas {$varC}</p> </td> </tr> <tr> <td> <p>|varTemp=varC</p> </td> <td> <p>Go Bananas {$varC}<sup class="footnoteref"><a id="footnoteref-648979-2" href="javascript:;" class="footnoteref" >2</a></sup></p> </td> </tr> <tr> <td> <p>|{$varTemp}=James!</p> </td> <td> <p>Go Bananas {$varC}<sup class="footnoteref"><a id="footnoteref-648979-3" href="javascript:;" class="footnoteref" >3</a></sup></p> </td> </tr> </table> <p>What we wanted to happen is for {$varTemp} to become <tt>varC</tt>, so that <tt>|varC=James!</tt>.<br /> This doesn't work, because<span style="white-space: pre-wrap;">&#32;[[include]]</span>:</p> <blockquote> <p>Replaces Variables <strong>in the included page only</strong>, according to the the definitions in the <span style="white-space: pre-wrap;">[[include]]</span> block</p> </blockquote> <div class="footnotes-footer"> <div class="title">Notes</div> <div class="footnote-footer" id="footnote-648979-1"><a href="javascript:;" >1</a>. There is no {$varTemp} in the included page at this moment, and so no changes are made to the included text.</div> <div class="footnote-footer" id="footnote-648979-2"><a href="javascript:;" >2</a>. Nothing changes because there is no variable {$varTemp} in the included page.</div> <div class="footnote-footer" id="footnote-648979-3"><a href="javascript:;" >3</a>. Nothing changes because there is no variable {${$varTemp}} (whatever that might mean) in the included page.</div> </div> <h2><span>Related Articles</span></h2> <ul> <li><a href="http://community.wikidot.com/howto:wikidot-includes:for-beginners">Wikidot Includes: For Beginners</a></li> <li><a href="http://community.wikidot.com/howto:wikidot-includes:techniques">Wikidot Include Techniques</a></li> </ul> <h2><span>Authors</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/james-kanjo" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7932347&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="James Kanjo" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7932347)" /></a><a href="http://www.wikidot.com/user:info/james-kanjo" >James Kanjo</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:james-kanjo">userPage</a>.</span></p> <p><span class="error-inline"><em>rurwin</em> does not match any existing user name</span>. <span style="font-size:smaller;">Please visit his/her <a class="newpage" href="http://community.wikidot.com/user:rurwin">userPage</a>.</span></p> <h2><span>Comments</span></h2> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/govegan" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=35113&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="GoVegan" style="background-image:url(http://www.wikidot.com/userkarma.php?u=35113)" /></a><a href="http://www.wikidot.com/user:info/govegan" >GoVegan</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:wikidot-includes:for-beginners</guid>
				<title>Wikidot Includes: For Beginners</title>
				<link>http://community.wikidot.com/howto:wikidot-includes:for-beginners</link>
				<description>

&lt;p&gt;Wikidot provides you with the ability to import another page&#039;s source code into your current page, and change variables within it. You can even include pages from other wikis&lt;sup class=&quot;footnoteref&quot;&gt;&lt;a id=&quot;footnoteref-562537-1&quot; href=&quot;javascript:;&quot; class=&quot;footnoteref&quot;  &gt;1&lt;/a&gt;&lt;/sup&gt;. This becomes very useful when you are re-inserting very similar code on multiple pages.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/govegan&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=35113&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;GoVegan&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=35113)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/govegan&quot;  &gt;GoVegan&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;footnotes-footer&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Footnotes&lt;/div&gt;
&lt;div class=&quot;footnote-footer&quot; id=&quot;footnote-562537-1&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;1&lt;/a&gt;. Unless the site Administrator has disabled cross-site-includes, in which case you can not include pages from the CSI-disabled site&lt;/div&gt;
&lt;/div&gt;
</description>
				<pubDate>Thu, 18 Mar 2010 23:43:38 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Wikidot provides you with the ability to import another page's source code into your current page, and change variables within it. You can even include pages from other wikis<sup class="footnoteref"><a id="footnoteref-758670-1" href="javascript:;" class="footnoteref" >1</a></sup>. This becomes very useful when you are re-inserting very similar code on multiple pages.</p> <p>For instance, if you are wanting to create a small information table on many pages, you might use the following code:</p> <div class="code"> <pre><code>[[div style=&quot;float: left;&quot;]] ||~ Name || Gold || ||~ Type || Mineral || ||~ Colour || Yellow || ||~ SLC || Solid || ||~ Shiny || Yes || [[/div]]</code></pre></div> <p>Which renders this floating table:</p> <div style="float: left;"> <table class="wiki-content-table"> <tr> <th>Name</th> <td>Gold</td> </tr> <tr> <th>Type</th> <td>Mineral</td> </tr> <tr> <th>Colour</th> <td>Yellow</td> </tr> <tr> <th>SLC<sup class="footnoteref"><a id="footnoteref-758670-2" href="javascript:;" class="footnoteref" >2</a></sup></th> <td>Solid</td> </tr> <tr> <th>Shiny</th> <td>Yes</td> </tr> </table> </div> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> But having to type in all of that code on so many pages&#8230; it's a lot of typing. Also, and more importantly, if you decide to get rid of the “Shiny” section in the future, it would be a nightmare to go to all of your pages and remove the “Shiny” code.<br /> This is why <em>includes</em> are useful, because you can create a single “master page” that controls everything that uses it. <p>So let's create a page called <strong>inc:info-table</strong>, and on it, we will have the following code:</p> <div class="code"> <pre><code>[[div style=&quot;float: left;&quot;]] ||~ Name || {$name} || ||~ Type || {$type} || ||~ Colour || {$colour} || ||~ SLC || {$slc} || ||~ Shiny || {$shiny} || [[/div]]</code></pre></div> <p>Take note of the funny words surrounded with curly brackets and a dollar symbol. These are called <em>Include Variables</em>. The word that follows the dollar symbol is the name you assign to the variable: <span style="font-size:110%;"><tt>{$<strong>variable-name</strong>}</tt></span><br /> Variables are dynamic, meaning that they can change depending on what you want them to be. If I want the variable {$name} to change to the word “Gold”, then all I need to do is to include the <tt>inc:info-table</tt> page, and type in <tt>|name=Gold</tt>.</p> <p>Let's put this into practice on our wiki pages. If we want to use the information table, all we need to do is paste the following code:</p> <div class="code"> <pre><code>[[include inc:info-table |name=Gold |type=Mineral |colour=Yellow |slc=Solid |shiny=Yes]]</code></pre></div> <p>This will render:</p> <div style="float: left;"> <table class="wiki-content-table"> <tr> <th>Name</th> <td>Gold</td> </tr> <tr> <th>Type</th> <td>Mineral</td> </tr> <tr> <th>Colour</th> <td>Yellow</td> </tr> <tr> <th>SLC</th> <td>Solid</td> </tr> <tr> <th>Shiny</th> <td>Yes</td> </tr> </table> </div> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> It's that easy. <h2><span>Variable Limitations</span></h2> <p>Now that you know how to create Wikidot Includes, it is important to know that there are limitations to the variable names you can use.</p> <p>Acceptable variable names may contain some or all of the following:</p> <ul> <li>Alphabetical characters (using the basic English alphabet only)</li> <li>Numerical characters (all digits from 0 to 9)</li> <li>Hyphens (the “-” character)</li> <li>Underscores (the “_” character)</li> </ul> <p>Wikidot Include Variables are <strong>case-sensitive</strong>. So the variable {$shiny} is a completely different variable to {$Shiny}.</p> <h2><span>Related Articles</span></h2> <ul> <li><a href="http://community.wikidot.com/howto:wikidot-includes:for-experts">Wikidot Includes: For Experts</a></li> <li><a href="http://community.wikidot.com/howto:wikidot-includes:techniques">Wikidot Include Techniques</a></li> </ul> <h2><span>Author</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/james-kanjo" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7932347&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="James Kanjo" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7932347)" /></a><a href="http://www.wikidot.com/user:info/james-kanjo" >James Kanjo</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:james-kanjo">userPage</a>.</span></p> <div style="display : none;"> <div class="footnotes-footer"> <div class="title">Footnotes</div> <div class="footnote-footer" id="footnote-758670-1"><a href="javascript:;" >1</a>. Unless the site Administrator has disabled cross-site-includes, in which case you can not include pages from the CSI-disabled site</div> <div class="footnote-footer" id="footnote-758670-2"><a href="javascript:;" >2</a>. <strong>S</strong>tandard <strong>L</strong>aboratory <strong>C</strong>onditions<br /> 25˚Celsius, 1 atmosphere</div> </div> </div> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/govegan" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=35113&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="GoVegan" style="background-image:url(http://www.wikidot.com/userkarma.php?u=35113)" /></a><a href="http://www.wikidot.com/user:info/govegan" >GoVegan</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/blog:new-how-tos</guid>
				<title>New How Tos</title>
				<link>http://community.wikidot.com/blog:new-how-tos</link>
				<description>

&lt;p&gt;Four Community How-To&#039;s reworked or created.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sat, 21 Mar 2009 21:24:05 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>Four Community How-To's reworked or created.</p> <div class="content-separator" style="display: none:"></div> <ul> <li>Corrected How-To <a href="http://community.wikidot.com/howto:include-variables-with-special-characters">Include Variables with Special Characters</a> (complete rewrite)</li> <li>Created How-To <a href="http://community.wikidot.com/howto:comment-nested">Nested Comments</a></li> <li>Created How-To <a href="http://community.wikidot.com/howto:include-inline">Include Inline</a></li> <li>Created How-To <a href="http://community.wikidot.com/howto:system-variables">System Variables</a>, also documented many of its <a href="http://community.wikidot.com/howto:system-variables-details">technical details</a></li> </ul> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/erichsteinboeck:system-variables</guid>
				<title>System Variables</title>
				<link>http://community.wikidot.com/erichsteinboeck:system-variables</link>
				<description>

&lt;div style=&quot;display: none;&quot;&gt;&lt;/div&gt;
&lt;h1&gt;&lt;span&gt;System Variables for your Wiki Page&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;The current implementation of &lt;a href=&quot;http://www.wikidot.com/doc:templates&quot;&gt;live templates&lt;/a&gt; allows the use of &lt;a href=&quot;http://www.wikidot.com/doc:templates#toc6&quot;&gt;page variables&lt;/a&gt; like &lt;tt&gt;%%title%%&lt;/tt&gt;, &lt;tt&gt;%%fullname%%&lt;/tt&gt;, &lt;tt&gt;%%category%%&lt;/tt&gt;, &lt;tt&gt;%%created_by%%&lt;/tt&gt;, and &lt;tt&gt;%%created_at%%&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Unfortunately you can use these page variables only within a live &lt;em&gt;template,&lt;/em&gt; not on your original &lt;em&gt;page.&lt;/em&gt; Have you ever wondered, if there &lt;em&gt;was&lt;/em&gt; a way to use these variables directly on your page?&lt;/p&gt;
&lt;p&gt;And even more &amp;#8212; what about a way to define your &lt;em&gt;own&lt;/em&gt; variables that you then can use (multiple times) on your page?&lt;/p&gt;
&lt;p&gt;Here may be a solution for you (before implementing this, please have a look at the &lt;a href=&quot;#limitations&quot;&gt;limitations&lt;/a&gt;).&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Step by Step&lt;/span&gt;&lt;/h2&gt;
&lt;h4&gt;&lt;span&gt;&lt;a name=&quot;step1&quot;&gt;&lt;/a&gt;Step 1&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Create an a live template called &lt;strong&gt;&lt;em&gt;category&lt;/em&gt;:_template&lt;/strong&gt;&lt;sup class=&quot;footnoteref&quot;&gt;&lt;a id=&quot;footnoteref-180515-1&quot; href=&quot;javascript:;&quot; class=&quot;footnoteref&quot;  &gt;1&lt;/a&gt;&lt;/sup&gt; in the category for which you&#039;d like to enable system variables with the following code.&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size:smaller;&quot;&gt;&lt;em&gt;Note:&lt;/em&gt; Copy/paste the code exactly as-is, don&#039;t remove or change anything&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[!--
[[code]]
[[include %%category%%:_endcomment]]
[[include %%fullname%%
title=%%title%% |
linked_title=[/%%fullname%% %%title%%] |
parent=%%parent_title%% |
parent_linked=[http://%%site_name%%.wikidot.com/%%parent_fullname%% %%parent_title%%] |
fullname=%%fullname%% |
name=%%name%% |
category=%%category%% |
link=%%link%% |
tags=%%tags%% |
_tags=%%_tags%% |
created_by=%%created_by%% |
rating=%%rating%% |
comments=%%comments%% |
revisions=%%revisions%% |
children=%%children%% |
size=%%size%% |
updated_by=%%updated_by%% |
created_at=%%created_at|%e %b %Y, %H:%M %Z%% |
created_at_start=%%created_at|[!--%%--] |
created_at_end=&amp;quot;]] |
updated_at=%%updated_at|%e %b %Y, %H:%M %Z%% |
updated_at_end=&amp;quot;]] |
updated_at_start=%%updated_at|[!--%%--] |
%%content{2}%%
]]
[[include %%category%%:_startcomment]]
[[/code]]
--]

[[include %%category%%:_startcomment]]
%%content{1}%%
[[include %%category%%:_endcomment]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span&gt;&lt;a name=&quot;step2&quot;&gt;&lt;/a&gt;Step 2&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Create a page called &lt;strong&gt;&lt;em&gt;category&lt;/em&gt;:_startcomment&lt;/strong&gt; in the same category as in &lt;a href=&quot;#step1&quot;&gt;Step 1&lt;/a&gt; with the following code.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[!--&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[code]]&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h4&gt;&lt;span&gt;&lt;a name=&quot;step3&quot;&gt;&lt;/a&gt;Step 3&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Create a page called &lt;strong&gt;&lt;em&gt;category&lt;/em&gt;:_endcomment&lt;/strong&gt; in the same category as in &lt;a href=&quot;#step1&quot;&gt;Step 1&lt;/a&gt; with the following code.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[/code]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;--]&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;&lt;span&gt;How does it work&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;The general idea here is, &lt;em&gt;not&lt;/em&gt; to leave page content rendering to the live template (which is what &amp;#8220;standard&amp;#8221; live templates do by specifying the &lt;tt&gt;%%content%%&lt;/tt&gt; variable), but instead directly &lt;em&gt;include&lt;/em&gt; the page content and at the same time supply all page variables as include variables.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&quot;http://community.wikidot.com/howto:system-variables-details&quot;&gt;System Variables: Details&lt;/a&gt; for a detailed technical discussion of the ideas and concepts used.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;&lt;a name=&quot;limitations&quot;&gt;&lt;/a&gt;Limitations&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;When using page variables through live templates, be aware of the following limitations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Previewing while editing a page will show artifacts: the text &amp;#8220;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:_startcomment]]&lt;/span&gt;&amp;#8221; at the very top of the page, and &amp;#8220;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:_endcomment]]&lt;/span&gt;&amp;#8221; at the very bottom of the page&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Some rare page contents, e. g. unbalanced &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[code]]&lt;/span&gt;&lt;/tt&gt; or &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[/code]]&lt;/span&gt;&lt;/tt&gt; tags without their corresponding counterpart, will break the live template&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;If you&#039;d like to enable system variables for the &lt;em&gt;default&lt;/em&gt; category, you&#039;d have to
&lt;ul&gt;
&lt;li&gt;change &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:_startcomment]]&lt;/span&gt;&lt;/tt&gt; to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%_startcomment]]&lt;/span&gt;&lt;/tt&gt;,&lt;/li&gt;
&lt;li&gt;change &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:_endcomment]]&lt;/span&gt;&lt;/tt&gt; to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%_endcomment]]&lt;/span&gt;&lt;/tt&gt; and&lt;/li&gt;
&lt;li&gt;name the pages created in &lt;a href=&quot;#step2&quot;&gt;Step 2&lt;/a&gt; and &lt;a href=&quot;#step3&quot;&gt;Step 3&lt;/a&gt; &lt;strong&gt;_default_startcomment&lt;/strong&gt; resp. &lt;strong&gt;_default_endcomment&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span&gt;Examples&lt;/span&gt;&lt;/h2&gt;
&lt;h5&gt;&lt;span&gt;System Variables&lt;/span&gt;&lt;/h5&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;&lt;strong&gt;Instead of using live template page variable &amp;#8230;&lt;/strong&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;strong&gt;Use include variable &amp;#8230;&lt;/strong&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%title%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$title}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$title}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%linked_title%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$linked_title}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$linked_title}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%parent_title%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$parent}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$parent}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%parent_title_linked%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$parent_linked}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$parent_linked}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%children%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$children}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$children}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%fullname%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$fullname}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$fullname}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%name%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$name}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$name}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%category%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$category}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$category}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%link%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$link}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$link}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%created_by%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$created_by}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$created_by}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%updated_by%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$updated_by}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$updated_by}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%rating%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$rating}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$rating}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%comments%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$comments}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$comments}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%revisions%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$revisions}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$revisions}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%size%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$size}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$size}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%tags%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$tags}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$tags}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%_tags%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$_tags}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$_tags}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%created_at%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$created_at}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$created_at}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%created_at| &lt;em&gt;format&lt;/em&gt;| agohover%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$created_at_start} &lt;em&gt;format&lt;/em&gt;| agohover{$created_at_end}&lt;/tt&gt;&lt;br /&gt;
e. g. &lt;tt&gt;{$created_at_start} %c| agohover {$created_at_end}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$created_at_start}%c|agohover{$created_at_end}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%updated_at%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$updated_at}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$updated_at}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;%%updated_at| &lt;em&gt;format&lt;/em&gt;| agohover%%&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;tt&gt;{$updated_at_start} &lt;em&gt;format&lt;/em&gt;| agohover {$updated_at_end}&lt;/tt&gt;&lt;br /&gt;
e. g. &lt;tt&gt;{$updated_at_start} %c| agohover {$updated_at_end}&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;{$updated_at_start}%c|agohover{$updated_at_end}&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h5&gt;&lt;span&gt;User Variables&lt;/span&gt;&lt;/h5&gt;
&lt;table style=&quot;border-collapse:collapse;border-top:2px solid;border-bottom:2px solid&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;padding:3px 1em 3px 0&quot;&gt;&lt;em&gt;&lt;strong&gt;What you type &amp;#8230;&lt;/strong&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;strong&gt;What you get &amp;#8230;&lt;/strong&gt;&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;border-top:1px solid&quot;&gt;
&lt;td style=&quot;padding:3px 1em 3px 0&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;+++++&lt;/span&gt; {$users} Users!&lt;br /&gt;
We have just reached {$users} registered users at Wikidot. Nice!&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[!--&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;====&lt;/span&gt;&lt;br /&gt;
users=300&amp;#160;000&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;====&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;--]&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;h5&gt;&lt;span&gt;{$users} Users!&lt;/span&gt;&lt;/h5&gt;
&lt;p&gt;We have just reached {$users} registered users at Wikidot. Nice!&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h5&gt;&lt;span&gt;Global Variables&lt;/span&gt;&lt;/h5&gt;
&lt;p&gt;This is pretty simple but may not be obvious. To be able to use variables in any page in the category, add them next to the System Variables. Right before the &amp;quot;%%content{2}%%&amp;quot;, you may define other variables besides system ones (e.g. you can put &amp;quot;users=300&amp;#160;000 |&amp;quot;). NOTE: You need to add a pipe &amp;quot;|&amp;quot; at the end of each global variable you define.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Links&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Community wishlist &lt;a href=&quot;http://community.wikidot.com/wishlist:14&quot;&gt;System variables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Comunity How-To &lt;a href=&quot;http://community.wikidot.com/howto:system-variables-details&quot;&gt;System Variables: Details&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span&gt;Backlinks&lt;/span&gt;&lt;/h2&gt;

&lt;h2&gt;&lt;span&gt;Author&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;. &lt;span style=&quot;font-size:smaller;&quot;&gt;Please visit his/her &lt;a href=&quot;http://community.wikidot.com/user:erichsteinboeck&quot;&gt;userPage&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;[!&amp;#8212;&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;footnotes-footer&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Footnotes&lt;/div&gt;
&lt;div class=&quot;footnote-footer&quot; id=&quot;footnote-180515-1&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;1&lt;/a&gt;. If you&#039;d like to enable system variables for the default category, see section &lt;a href=&quot;#limitations&quot;&gt;Limitations&lt;/a&gt; for the changes that need to be done&lt;/div&gt;
&lt;/div&gt;
</description>
				<pubDate>Sat, 21 Mar 2009 12:42:58 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <div style="display: none;"></div> <h1><span>System Variables for your Wiki Page</span></h1> <p>The current implementation of <a href="http://www.wikidot.com/doc:templates">live templates</a> allows the use of <a href="http://www.wikidot.com/doc:templates#toc6">page variables</a> like <tt>%%title%%</tt>, <tt>%%fullname%%</tt>, <tt>%%category%%</tt>, <tt>%%created_by%%</tt>, and <tt>%%created_at%%</tt>.</p> <p>Unfortunately you can use these page variables only within a live <em>template,</em> not on your original <em>page.</em> Have you ever wondered, if there <em>was</em> a way to use these variables directly on your page?</p> <p>And even more &#8212; what about a way to define your <em>own</em> variables that you then can use (multiple times) on your page?</p> <p>Here may be a solution for you (before implementing this, please have a look at the <a href="#limitations">limitations</a>).</p> <h2><span>Step by Step</span></h2> <h4><span><a name="step1"></a>Step 1</span></h4> <p>Create an a live template called <strong><em>category</em>:_template</strong><sup class="footnoteref"><a id="footnoteref-980125-1" href="javascript:;" class="footnoteref" >1</a></sup> in the category for which you'd like to enable system variables with the following code.</p> <p><span style="font-size:smaller;"><em>Note:</em> Copy/paste the code exactly as-is, don't remove or change anything</span></p> <div class="code"> <pre><code>[!-- [[code]] [[include %%category%%:_endcomment]] [[include %%fullname%% title=%%title%% | linked_title=[/%%fullname%% %%title%%] | parent=%%parent_title%% | parent_linked=[http://%%site_name%%.wikidot.com/%%parent_fullname%% %%parent_title%%] | fullname=%%fullname%% | name=%%name%% | category=%%category%% | link=%%link%% | tags=%%tags%% | _tags=%%_tags%% | created_by=%%created_by%% | rating=%%rating%% | comments=%%comments%% | revisions=%%revisions%% | children=%%children%% | size=%%size%% | updated_by=%%updated_by%% | created_at=%%created_at|%e %b %Y, %H:%M %Z%% | created_at_start=%%created_at|[!--%%--] | created_at_end=&quot;]] | updated_at=%%updated_at|%e %b %Y, %H:%M %Z%% | updated_at_end=&quot;]] | updated_at_start=%%updated_at|[!--%%--] | %%content{2}%% ]] [[include %%category%%:_startcomment]] [[/code]] --] [[include %%category%%:_startcomment]] %%content{1}%% [[include %%category%%:_endcomment]]</code></pre></div> <h4><span><a name="step2"></a>Step 2</span></h4> <p>Create a page called <strong><em>category</em>:_startcomment</strong> in the same category as in <a href="#step1">Step 1</a> with the following code.</p> <div class="code"> <p><span style="white-space: pre-wrap;">[!--</span><br /> <span style="white-space: pre-wrap;">[[code]]</span></p> </div> <h4><span><a name="step3"></a>Step 3</span></h4> <p>Create a page called <strong><em>category</em>:_endcomment</strong> in the same category as in <a href="#step1">Step 1</a> with the following code.</p> <div class="code"> <p><span style="white-space: pre-wrap;">[[/code]]</span><br /> <span style="white-space: pre-wrap;">--]</span></p> </div> <h2><span>How does it work</span></h2> <p>The general idea here is, <em>not</em> to leave page content rendering to the live template (which is what &#8220;standard&#8221; live templates do by specifying the <tt>%%content%%</tt> variable), but instead directly <em>include</em> the page content and at the same time supply all page variables as include variables.</p> <p>See <a href="http://community.wikidot.com/howto:system-variables-details">System Variables: Details</a> for a detailed technical discussion of the ideas and concepts used.</p> <h2><span><a name="limitations"></a>Limitations</span></h2> <p>When using page variables through live templates, be aware of the following limitations:</p> <ul> <li>Previewing while editing a page will show artifacts: the text &#8220;<span style="white-space: pre-wrap;">[[include&#32;%%category%%:_startcomment]]</span>&#8221; at the very top of the page, and &#8220;<span style="white-space: pre-wrap;">[[include&#32;%%category%%:_endcomment]]</span>&#8221; at the very bottom of the page<br /> <br /></li> <li>Some rare page contents, e. g. unbalanced <tt><span style="white-space: pre-wrap;">[[code]]</span></tt> or <tt><span style="white-space: pre-wrap;">[[/code]]</span></tt> tags without their corresponding counterpart, will break the live template<br /> <br /></li> <li>If you'd like to enable system variables for the <em>default</em> category, you'd have to <ul> <li>change <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%:_startcomment]]</span></tt> to <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%_startcomment]]</span></tt>,</li> <li>change <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%:_endcomment]]</span></tt> to <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%_endcomment]]</span></tt> and</li> <li>name the pages created in <a href="#step2">Step 2</a> and <a href="#step3">Step 3</a> <strong>_default_startcomment</strong> resp. <strong>_default_endcomment</strong></li> </ul> </li> </ul> <h2><span>Examples</span></h2> <h5><span>System Variables</span></h5> <table> <tr> <td><em><strong>Instead of using live template page variable &#8230;</strong></em></td> <td><em><strong>Use include variable &#8230;</strong></em></td> <td><em><strong>Example</strong></em></td> </tr> <tr> <td><tt>%%title%%</tt></td> <td><tt>{$title}</tt></td> <td>{$title}</td> </tr> <tr> <td><tt>%%linked_title%%</tt></td> <td><tt>{$linked_title}</tt></td> <td>{$linked_title}</td> </tr> <tr> <td><tt>%%parent_title%%</tt></td> <td><tt>{$parent}</tt></td> <td>{$parent}</td> </tr> <tr> <td><tt>%%parent_title_linked%%</tt></td> <td><tt>{$parent_linked}</tt></td> <td>{$parent_linked}</td> </tr> <tr> <td><tt>%%children%%</tt></td> <td><tt>{$children}</tt></td> <td>{$children}</td> </tr> <tr> <td><tt>%%fullname%%</tt></td> <td><tt>{$fullname}</tt></td> <td>{$fullname}</td> </tr> <tr> <td><tt>%%name%%</tt></td> <td><tt>{$name}</tt></td> <td>{$name}</td> </tr> <tr> <td><tt>%%category%%</tt></td> <td><tt>{$category}</tt></td> <td>{$category}</td> </tr> <tr> <td><tt>%%link%%</tt></td> <td><tt>{$link}</tt></td> <td>{$link}</td> </tr> <tr> <td><tt>%%created_by%%</tt></td> <td><tt>{$created_by}</tt></td> <td>{$created_by}</td> </tr> <tr> <td><tt>%%updated_by%%</tt></td> <td><tt>{$updated_by}</tt></td> <td>{$updated_by}</td> </tr> <tr> <td><tt>%%rating%%</tt></td> <td><tt>{$rating}</tt></td> <td>{$rating}</td> </tr> <tr> <td><tt>%%comments%%</tt></td> <td><tt>{$comments}</tt></td> <td>{$comments}</td> </tr> <tr> <td><tt>%%revisions%%</tt></td> <td><tt>{$revisions}</tt></td> <td>{$revisions}</td> </tr> <tr> <td><tt>%%size%%</tt></td> <td><tt>{$size}</tt></td> <td>{$size}</td> </tr> <tr> <td><tt>%%tags%%</tt></td> <td><tt>{$tags}</tt></td> <td>{$tags}</td> </tr> <tr> <td><tt>%%_tags%%</tt></td> <td><tt>{$_tags}</tt></td> <td>{$_tags}</td> </tr> <tr> <td><tt>%%created_at%%</tt></td> <td><tt>{$created_at}</tt></td> <td>{$created_at}</td> </tr> <tr> <td><tt>%%created_at| <em>format</em>| agohover%%</tt></td> <td><tt>{$created_at_start} <em>format</em>| agohover{$created_at_end}</tt><br /> e. g. <tt>{$created_at_start} %c| agohover {$created_at_end}</tt></td> <td>{$created_at_start}%c|agohover{$created_at_end}</td> </tr> <tr> <td><tt>%%updated_at%%</tt></td> <td><tt>{$updated_at}</tt></td> <td>{$updated_at}</td> </tr> <tr> <td><tt>%%updated_at| <em>format</em>| agohover%%</tt></td> <td><tt>{$updated_at_start} <em>format</em>| agohover {$updated_at_end}</tt><br /> e. g. <tt>{$updated_at_start} %c| agohover {$updated_at_end}</tt></td> <td>{$updated_at_start}%c|agohover{$updated_at_end}</td> </tr> </table> <h5><span>User Variables</span></h5> <table style="border-collapse:collapse;border-top:2px solid;border-bottom:2px solid"> <tr> <td style="padding:3px 1em 3px 0"><em><strong>What you type &#8230;</strong></em></td> <td><em><strong>What you get &#8230;</strong></em></td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <p><span style="white-space: pre-wrap;">+++++</span> {$users} Users!<br /> We have just reached {$users} registered users at Wikidot. Nice!<br /> .<br /> .<br /> <span style="white-space: pre-wrap;">[!--</span><br /> <span style="white-space: pre-wrap;">====</span><br /> users=300&#160;000<br /> <span style="white-space: pre-wrap;">====</span><br /> <span style="white-space: pre-wrap;">--]</span></p> </div> </td> <td> <h5><span>{$users} Users!</span></h5> <p>We have just reached {$users} registered users at Wikidot. Nice!</p> </td> </tr> </table> <h5><span>Global Variables</span></h5> <p>This is pretty simple but may not be obvious. To be able to use variables in any page in the category, add them next to the System Variables. Right before the &quot;%%content{2}%%&quot;, you may define other variables besides system ones (e.g. you can put &quot;users=300&#160;000 |&quot;). NOTE: You need to add a pipe &quot;|&quot; at the end of each global variable you define.</p> <h2><span>Links</span></h2> <ul> <li>Community wishlist <a href="http://community.wikidot.com/wishlist:14">System variables</a></li> <li>Comunity How-To <a href="http://community.wikidot.com/howto:system-variables-details">System Variables: Details</a></li> </ul> <h2><span>Backlinks</span></h2> <h2><span>Author</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:erichsteinboeck">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span></p> <div class="footnotes-footer"> <div class="title">Footnotes</div> <div class="footnote-footer" id="footnote-980125-1"><a href="javascript:;" >1</a>. If you'd like to enable system variables for the default category, see section <a href="#limitations">Limitations</a> for the changes that need to be done</div> </div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:system-variables-details</guid>
				<title>System Variables: Details</title>
				<link>http://community.wikidot.com/howto:system-variables-details</link>
				<description>

&lt;h1&gt;&lt;span&gt;System Variables for your Wiki Page: Technical Details&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;Here you&#039;ll find a technical analysis of the Community How-To &lt;a href=&quot;http://community.wikidot.com/howto:system-variables&quot;&gt;System Variables&lt;/a&gt;. If you just want to &lt;em&gt;use&lt;/em&gt; the How-To, it is not necessary to understand the technical concepts presented here. Continue reading only if you&#039;d like to understand more about the inner workings of Wikidot.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;How the Idea Developed&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;To implement system variables for a Wikidot page you need variable, replaceable content. As an obvious candidate for any replaceable content are include variables, this automatically leads to the idea to include the Wikidot page from a live template. Once this concept is born, you&#039;d think, that an implementation should be straightforward.&lt;/p&gt;
&lt;p&gt;Far from it.&lt;/p&gt;
&lt;p&gt;Here some of the challenges and chosen solutions are presented.&lt;/p&gt;
&lt;h4&gt;&lt;span&gt;Basic Concept&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Here&#039;s the basic concept, we&#039;re starting with: a &lt;a href=&quot;http://www.wikidot.com/doc:templates&quot;&gt;live template&lt;/a&gt; directly includes its calling page, supplying all page variables as include variables.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include %%page_unix_name%%
| page_unix_name=%%page_unix_name%%
| page_name=%%page_name%%
.
.
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span&gt;Trailing Consecutive Brackets&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;Challenge:&lt;/em&gt; Adding &lt;tt&gt;author=%%author%%&lt;/tt&gt; to the above basic &lt;tt&gt;include&lt;/tt&gt; poses the first challenge: as &lt;tt&gt;%%author%%&lt;/tt&gt; resolves to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[*&lt;/span&gt;user &lt;em&gt;user-name&lt;/em&gt;]]&lt;/tt&gt;, those two trailing consecutive closing brackets (&amp;#8220;&lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]&lt;/span&gt;&lt;/tt&gt;&amp;#8221;) would break parsing of the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[&lt;/span&gt;include &amp;#8230;]]&lt;/tt&gt; statement.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; two consecutive closing brackets only break parsing if the brackets are the very last characters on its line. To avoid such a situation, we will move the leading pipe (&amp;#8220;|&amp;#8221;) symbol in each line to the end of each line &amp;#8212; so no two consecutive brackets can ever be at the very end of a line. In general, it is best that you &lt;em&gt;always&lt;/em&gt; write your &lt;tt&gt;include&lt;/tt&gt; like this (and &lt;em&gt;not&lt;/em&gt; like the &lt;a href=&quot;http://www.wikidot.com/doc:wiki-syntax#include&quot;&gt;include example in the docs&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;So we rewrite the include with trailing pipe (&amp;#8220;|&amp;#8221;) symbols:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include %%page_unix_name%%
page_unix_name=%%page_unix_name%% |
page_name=%%page_name%% |
author=%%author%% |
.
.
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span&gt;Pipe Symbol in Internal Links&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;Challenge:&lt;/em&gt; Adding &lt;tt&gt;linked_title=%%linked_title%%&lt;/tt&gt; to the above &lt;tt&gt;include&lt;/tt&gt; poses another challenge: as &lt;tt&gt;%%linked_title%%&lt;/tt&gt; resolves to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[[&lt;/span&gt;&lt;em&gt;%%page_unix_name%%&lt;/em&gt;|&lt;em&gt;%%title%%&lt;/em&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]]&lt;/span&gt;&lt;/tt&gt;, the embedded pipe (&amp;#8220;|&amp;#8221;) symbol again breaks parsing of the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[&lt;/span&gt;include &amp;#8230;]]&lt;/tt&gt; statement.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; The How-To &lt;a href=&quot;http://community.wikidot.com/howto:include-variables-with-special-characters&quot;&gt;Include variables with special characters&lt;/a&gt; suggests this workaround:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;p&gt;linked_title=&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[[&lt;/span&gt;%%page_unix_name%%&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;pipe{$br}]&lt;/span&gt;&lt;br /&gt;
%%title%%&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]]&lt;/span&gt; |&lt;br /&gt;
br=]&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
where page &lt;strong&gt;pipe&lt;/strong&gt; contains a pipe (&amp;#8220;|&amp;#8221;) symbol only.
&lt;p&gt;As in our case we&#039;re able to rewrite the internal link to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[/&lt;/span&gt;%%page_unix_name%% %%title%%&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]]&lt;/span&gt;&lt;/tt&gt;, we&#039;ll use this simpler approach.&lt;sup class=&quot;footnoteref&quot;&gt;&lt;a id=&quot;footnoteref-312376-1&quot; href=&quot;javascript:;&quot; class=&quot;footnoteref&quot;  &gt;1&lt;/a&gt;&lt;/sup&gt; Here&#039;s our code so far:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include %%page_unix_name%%
page_unix_name=%%page_unix_name%% |
page_name=%%page_name%% |
author=%%author%% |
linked_title=[/%%page_unix_name%% %%title%%] |
.
.
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span&gt;Date&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;Challenge:&lt;/em&gt; Adding &lt;tt&gt;date=%%date%%&lt;/tt&gt; presents the next challenge: as &lt;tt&gt;%%date%%&lt;/tt&gt; resolves to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[date&lt;/span&gt; &lt;em&gt;timestamp&lt;/em&gt; &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;format=&amp;quot;%e&amp;#32;%b&amp;#32;%Y,&amp;#32;%H:%M&amp;#32;%Z|agohover&amp;quot;]]&lt;/span&gt;&lt;/tt&gt;, the embedded pipe (&amp;#8220;|&amp;#8221;) symbol again breaks parsing of the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[&lt;/span&gt;include &amp;#8230;]]&lt;/tt&gt; statement.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; There doesn&#039;t seem to be a way to transport &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[date&lt;/span&gt; &lt;em&gt;timestamp&lt;/em&gt; &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;format=&amp;quot;%e&amp;#32;%b&amp;#32;%Y,&amp;#32;%H:%M&amp;#32;%Z|agohover&amp;quot;]]&lt;/span&gt;&lt;/tt&gt; to the calling page through an include variable. So we do two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We remove the pipe (&amp;#8220;&lt;tt&gt;|&lt;/tt&gt;&amp;#8221;) symbol in &lt;tt&gt;format=&amp;quot;&amp;#8230;|agohover&amp;quot;&lt;/tt&gt; by specifying &lt;tt&gt;date=%%date|%e %b %Y, %H:%M %Z%%&lt;/tt&gt; which resolves to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[date&lt;/span&gt; &lt;em&gt;timestamp&lt;/em&gt; &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;format=&amp;quot;%e&amp;#32;%b&amp;#32;%Y,&amp;#32;%H:%M&amp;#32;%Z&amp;quot;]]&lt;/span&gt;&lt;/tt&gt; which will work fine on the include. Note that this makes &lt;tt&gt;%%date%%&lt;/tt&gt; slightly incompatible with &lt;tt&gt;{$date}&lt;/tt&gt;, as the &amp;#8220;&amp;#8230; ago&amp;#8221; hovering text is removed.&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;To support the equivalent of the &lt;tt&gt;%%date|&lt;em&gt;format-string&lt;/em&gt;%%&lt;/tt&gt; page variable, two include variables are defined: &lt;tt&gt;{$date_start}&lt;/tt&gt; and &lt;tt&gt;{$date_end}&lt;/tt&gt;. When used together as in &lt;tt&gt;{$date_start}&lt;em&gt;format-string&lt;/em&gt;{$date_end}&lt;/tt&gt; the result is equivalent to &lt;tt&gt;%%date|&lt;em&gt;format-string&lt;/em&gt;%%&lt;/tt&gt;
&lt;ul&gt;
&lt;li&gt;To implement &lt;tt&gt;{$date_start}&lt;/tt&gt; we add &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;date_start=%%date|[!--%%--]&lt;/span&gt;&lt;/tt&gt; to the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt;. As &lt;tt&gt;%%&amp;#8230;%%&lt;/tt&gt; page variable parsing is done at an early stage (i. e. &lt;em&gt;before&lt;/em&gt; &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; parsing), it resolves to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[date&lt;/span&gt; &lt;em&gt;timestamp&lt;/em&gt; &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;format=&amp;quot;[!--&amp;quot;]]--]&lt;/span&gt;&lt;/tt&gt;, which &amp;#8212; if we ignore the trailing Wikidot comment &amp;#8212; is equivalent to &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[date&lt;/span&gt; &lt;em&gt;timestamp&lt;/em&gt; &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;format=&amp;quot;&lt;/span&gt;&lt;/tt&gt;. Exactly the first &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[date&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; part that we need.&lt;/li&gt;
&lt;li&gt;To implement &lt;tt&gt;{$date_end}&lt;/tt&gt; we simply add &lt;tt&gt;date_end=&amp;quot;]]&lt;/tt&gt; to the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;At this point our code looks like this:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include %%page_unix_name%%
page_unix_name=%%page_unix_name%% |
page_name=%%page_name%% |
author=%%author%% |
linked_title=[/%%page_unix_name%% %%title%%] |
date_start=%%date|[!--%%--] |
date_end=&amp;quot;]] |
.
.
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span&gt;Live Template&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;One might think that we&#039;ve made it: the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; with all include variables has been defined properly. But &amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Challenge:&lt;/em&gt; The code we wrote isn&#039;t recognized as a valid live template.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; Live templates not only (as documented) must be named &lt;strong&gt;_template&lt;/strong&gt; , but (not documented) they also &lt;em&gt;must&lt;/em&gt; contain either &lt;tt&gt;%%content%%&lt;/tt&gt; or &lt;tt&gt;%%content{&lt;em&gt;number&lt;/em&gt;}%%&lt;/tt&gt;, where &lt;em&gt;number&lt;/em&gt; is a string comprised of digits 0&amp;#8230;9 only.&lt;/p&gt;
&lt;p&gt;Now, that&#039;s a challenge, because we do &lt;em&gt;not&lt;/em&gt; want the page content added &lt;em&gt;in addition&lt;/em&gt; to our include which already &lt;em&gt;adds&lt;/em&gt; the page content.&lt;/p&gt;
&lt;p&gt;One solution might be to add &lt;tt&gt;%%content{0}%%&lt;/tt&gt;, which is sufficient for a template to be recognized as a live template. It will always resolve empty, as actual page section numbers start with one.&lt;/p&gt;
&lt;p&gt;A different approach would be to add&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[!--
%%content%%
--]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;br /&gt;
Again this would be enough for a live template to be recognized as such (it doesn&#039;t matter that &lt;tt&gt;%%content%%&lt;/tt&gt; is surrounded by a Wikidot comment). But be aware that the comments would fail to hide &lt;em&gt;all&lt;/em&gt; of the page content, if the content itself contained a Wikidot comment. The comment end tag (&lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;--]&lt;/span&gt;&lt;/tt&gt;) of this comment would then prematurely end the surrounding comment from the above code!
&lt;p&gt;For such a case, the Community How-To &lt;a href=&quot;http://community.wikidot.com/howto:comment-nested&quot;&gt;Nested Comments&lt;/a&gt; suggests the following solution:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[!--
[[code]]
%%content%%
[[/code]]
--]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But for now, let&#039;s assume we chose to add &lt;tt&gt;%%content{0}%%&lt;/tt&gt; &amp;#8212; this would make our code look like this:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include %%page_unix_name%%
page_unix_name=%%page_unix_name%% |
page_name=%%page_name%% |
author=%%author%% |
linked_title=[/%%page_unix_name%% %%title%%] |
date_start=%%date|[!--%%--] |
date_end=&amp;quot;]] |
.
.
]]
%%content{0}%%&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span&gt;Preview&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Did we finally make it? Everything working as intended? Unfortunately, no. What happens if &amp;#8212; while editing your page content &amp;#8212; you do a &amp;#8220;preview&amp;#8221; from the editor?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Challenge:&lt;/em&gt; During a &amp;#8220;preview&amp;#8221; just the above &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; code is rendered: as code, and not as the processed include. No page content is shown at all! Our live template designed so far completely breaks &amp;#8220;preview&amp;#8221;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; As &amp;#8220;preview&amp;#8221; does not resolve &lt;tt&gt;%%&amp;#8230;%%&lt;/tt&gt; page variables of a live template, it will not resolve &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%page_unix_name%%&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; and as such does not show the page content as intended (if you&#039;d &lt;em&gt;save&lt;/em&gt; the page, everything worked fine, but we&#039;re looking for a solution for &amp;#8220;preview&amp;#8221; mode).&lt;/p&gt;
&lt;p&gt;We could show the content during preview if we simply added &lt;tt&gt;%%content%%&lt;/tt&gt;, but then it would show &lt;em&gt;twice&lt;/em&gt; on the &lt;em&gt;saved&lt;/em&gt; page: once through the include and a second time because of the added &lt;tt&gt;%%content%%&lt;/tt&gt;. So we need a way to display &lt;tt&gt;%%content%%&lt;/tt&gt; &lt;em&gt;just during preview&lt;/em&gt;. Here is the chosen solution. We add the following code:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[include %%category%%:_startcomment]]
%%content%%
[[include %%category%%:_endcomment]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Where (within the same category)&lt;/p&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;page &lt;strong&gt;_startcomment&lt;/strong&gt; contains&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[!--&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[code]]&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding-left:1em&quot;&gt;
&lt;p&gt;page &lt;strong&gt;_endcomment&lt;/strong&gt; contains&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[/code]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;--]&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;As we saw before, neither &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:_startcomment]]&lt;/span&gt;&lt;/tt&gt; nor &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:_endcomment]]&lt;/span&gt;&lt;/tt&gt; is resolved during &amp;#8220;preview&amp;#8221; and page content will be shown &amp;#8212; unfortunately along with the page content those &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:&lt;/span&gt;&amp;#8230;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]&lt;/span&gt;&lt;/tt&gt; tags will also be shown as plain text.&lt;/p&gt;
&lt;p&gt;When the page is saved, both &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:&lt;/span&gt;&amp;#8230;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]&lt;/span&gt;&lt;/tt&gt; will be resolved and will completely comment (and thus remove) &lt;tt&gt;%%comment%%&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Page content is now shown properly both during preview and on the saved page, but as described above we still see &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; code rendered as plain text during preview. Can we remove it? Here&#039;s a way: we&#039;ll surround the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; code with&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[!--&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[code]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:_endcomment]]&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
and
&lt;div class=&quot;code&quot;&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:_startcomment]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[/code]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;--]&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
We&#039;re again applying the idea presented above: the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:&lt;/span&gt;&amp;#8230;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]&lt;/span&gt;&lt;/tt&gt; are not resolved during preview and thus the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; code is commented by the Wikidot comment. When the page is &lt;em&gt;saved&lt;/em&gt; the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;%%category%%:&lt;/span&gt;&amp;#8230;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]&lt;/span&gt;&lt;/tt&gt; &lt;em&gt;are&lt;/em&gt; resolved and become empty Wikidot comments, leaving the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; intact.
&lt;p&gt;Meanwhile our code looks like this:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[!--
[[code]]
[[include %%category%%:_endcomment]]
[[include %%page_unix_name%%
page_unix_name=%%page_unix_name%% |
page_name=%%page_name%% |
author=%%author%% |
linked_title=[/%%page_unix_name%% %%title%%] |
date_start=%%date|[!--%%--] |
date_end=&amp;quot;]] |
.
.
]]
[[include %%category%%:_startcomment]]
[[/code]]
--]
[[include %%category%%:_startcomment]]
%%content%%
[[include %%category%%:_endcomment]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span&gt;&lt;a name=&quot;user-variables&quot;&gt;&lt;/a&gt;User Variables&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;Challenge:&lt;/em&gt; In addition to &lt;em&gt;system&lt;/em&gt; variables it may sometimes be desirable to define your own &lt;em&gt;user&lt;/em&gt; variable that could be used on the page. If any piece of text or code is to be used multiple times on a page, such user variables may simplify page maintenance as any changes to the common part needs only to be done once.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; By inserting &lt;tt&gt;%%content{2}%%&lt;/tt&gt; to the list of include variables, it is possible to define user variables (in standard include variable syntax, like &lt;tt&gt;width=100px | name=standard.jpg&lt;/tt&gt; in a second page section (separated from the main content by a content splitter &lt;tt&gt;====&lt;/tt&gt;).&lt;/p&gt;
&lt;p&gt;Which gives us the final live template code:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[!--
[[code]]
[[include %%category%%:_endcomment]]
[[include %%page_unix_name%%
page_unix_name=%%page_unix_name%% |
page_name=%%page_name%% |
author=%%author%% |
linked_title=[/%%page_unix_name%% %%title%%] |
date_start=%%date|[!--%%--] |
date_end=&amp;quot;]] |
.
.
%%content{2}%%
]]
[[include %%category%%:_startcomment]]
[[/code]]
--]
[[include %%category%%:_startcomment]]
%%content%%
[[include %%category%%:_endcomment]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;footnotes-footer&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Footnotes&lt;/div&gt;
&lt;div class=&quot;footnote-footer&quot; id=&quot;footnote-312376-1&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;1&lt;/a&gt;. There&#039;s a disadvantage in this approach: if %%title% is empty, this link breaks&lt;/div&gt;
&lt;/div&gt;
</description>
				<pubDate>Sat, 21 Mar 2009 12:11:25 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h1><span>System Variables for your Wiki Page: Technical Details</span></h1> <p>Here you'll find a technical analysis of the Community How-To <a href="http://community.wikidot.com/howto:system-variables">System Variables</a>. If you just want to <em>use</em> the How-To, it is not necessary to understand the technical concepts presented here. Continue reading only if you'd like to understand more about the inner workings of Wikidot.</p> <h2><span>How the Idea Developed</span></h2> <p>To implement system variables for a Wikidot page you need variable, replaceable content. As an obvious candidate for any replaceable content are include variables, this automatically leads to the idea to include the Wikidot page from a live template. Once this concept is born, you'd think, that an implementation should be straightforward.</p> <p>Far from it.</p> <p>Here some of the challenges and chosen solutions are presented.</p> <h4><span>Basic Concept</span></h4> <p>Here's the basic concept, we're starting with: a <a href="http://www.wikidot.com/doc:templates">live template</a> directly includes its calling page, supplying all page variables as include variables.</p> <div class="code"> <pre><code>[[include %%page_unix_name%% | page_unix_name=%%page_unix_name%% | page_name=%%page_name%% . . ]]</code></pre></div> <h4><span>Trailing Consecutive Brackets</span></h4> <p><em>Challenge:</em> Adding <tt>author=%%author%%</tt> to the above basic <tt>include</tt> poses the first challenge: as <tt>%%author%%</tt> resolves to <tt><span style="white-space: pre-wrap;">[[*</span>user <em>user-name</em>]]</tt>, those two trailing consecutive closing brackets (&#8220;<tt><span style="white-space: pre-wrap;">]]</span></tt>&#8221;) would break parsing of the <tt><span style="white-space: pre-wrap;">[[</span>include &#8230;]]</tt> statement.</p> <p><em>Solution:</em> two consecutive closing brackets only break parsing if the brackets are the very last characters on its line. To avoid such a situation, we will move the leading pipe (&#8220;|&#8221;) symbol in each line to the end of each line &#8212; so no two consecutive brackets can ever be at the very end of a line. In general, it is best that you <em>always</em> write your <tt>include</tt> like this (and <em>not</em> like the <a href="http://www.wikidot.com/doc:wiki-syntax#include">include example in the docs</a>).</p> <p>So we rewrite the include with trailing pipe (&#8220;|&#8221;) symbols:</p> <div class="code"> <pre><code>[[include %%page_unix_name%% page_unix_name=%%page_unix_name%% | page_name=%%page_name%% | author=%%author%% | . . ]]</code></pre></div> <h4><span>Pipe Symbol in Internal Links</span></h4> <p><em>Challenge:</em> Adding <tt>linked_title=%%linked_title%%</tt> to the above <tt>include</tt> poses another challenge: as <tt>%%linked_title%%</tt> resolves to <tt><span style="white-space: pre-wrap;">[[[</span><em>%%page_unix_name%%</em>|<em>%%title%%</em><span style="white-space: pre-wrap;">]]]</span></tt>, the embedded pipe (&#8220;|&#8221;) symbol again breaks parsing of the <tt><span style="white-space: pre-wrap;">[[</span>include &#8230;]]</tt> statement.</p> <p><em>Solution:</em> The How-To <a href="http://community.wikidot.com/howto:include-variables-with-special-characters">Include variables with special characters</a> suggests this workaround:</p> <div class="code"> <p>linked_title=<span style="white-space: pre-wrap;">[[[</span>%%page_unix_name%%<br /> <span style="white-space: pre-wrap;">[[include&#32;pipe{$br}]</span><br /> %%title%%<span style="white-space: pre-wrap;">]]]</span> |<br /> br=]</p> </div> <br /> where page <strong>pipe</strong> contains a pipe (&#8220;|&#8221;) symbol only. <p>As in our case we're able to rewrite the internal link to <tt><span style="white-space: pre-wrap;">[/</span>%%page_unix_name%% %%title%%<span style="white-space: pre-wrap;">]]]</span></tt>, we'll use this simpler approach.<sup class="footnoteref"><a id="footnoteref-887237-1" href="javascript:;" class="footnoteref" >1</a></sup> Here's our code so far:</p> <div class="code"> <pre><code>[[include %%page_unix_name%% page_unix_name=%%page_unix_name%% | page_name=%%page_name%% | author=%%author%% | linked_title=[/%%page_unix_name%% %%title%%] | . . ]]</code></pre></div> <h4><span>Date</span></h4> <p><em>Challenge:</em> Adding <tt>date=%%date%%</tt> presents the next challenge: as <tt>%%date%%</tt> resolves to <tt><span style="white-space: pre-wrap;">[[date</span> <em>timestamp</em> <span style="white-space: pre-wrap;">format=&quot;%e&#32;%b&#32;%Y,&#32;%H:%M&#32;%Z|agohover&quot;]]</span></tt>, the embedded pipe (&#8220;|&#8221;) symbol again breaks parsing of the <tt><span style="white-space: pre-wrap;">[[</span>include &#8230;]]</tt> statement.</p> <p><em>Solution:</em> There doesn't seem to be a way to transport <tt><span style="white-space: pre-wrap;">[[date</span> <em>timestamp</em> <span style="white-space: pre-wrap;">format=&quot;%e&#32;%b&#32;%Y,&#32;%H:%M&#32;%Z|agohover&quot;]]</span></tt> to the calling page through an include variable. So we do two things:</p> <ol> <li>We remove the pipe (&#8220;<tt>|</tt>&#8221;) symbol in <tt>format=&quot;&#8230;|agohover&quot;</tt> by specifying <tt>date=%%date|%e %b %Y, %H:%M %Z%%</tt> which resolves to <tt><span style="white-space: pre-wrap;">[[date</span> <em>timestamp</em> <span style="white-space: pre-wrap;">format=&quot;%e&#32;%b&#32;%Y,&#32;%H:%M&#32;%Z&quot;]]</span></tt> which will work fine on the include. Note that this makes <tt>%%date%%</tt> slightly incompatible with <tt>{$date}</tt>, as the &#8220;&#8230; ago&#8221; hovering text is removed.<br /> <br /></li> <li>To support the equivalent of the <tt>%%date|<em>format-string</em>%%</tt> page variable, two include variables are defined: <tt>{$date_start}</tt> and <tt>{$date_end}</tt>. When used together as in <tt>{$date_start}<em>format-string</em>{$date_end}</tt> the result is equivalent to <tt>%%date|<em>format-string</em>%%</tt> <ul> <li>To implement <tt>{$date_start}</tt> we add <tt><span style="white-space: pre-wrap;">date_start=%%date|[!--%%--]</span></tt> to the <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt>. As <tt>%%&#8230;%%</tt> page variable parsing is done at an early stage (i. e. <em>before</em> <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> parsing), it resolves to <tt><span style="white-space: pre-wrap;">[[date</span> <em>timestamp</em> <span style="white-space: pre-wrap;">format=&quot;[!--&quot;]]--]</span></tt>, which &#8212; if we ignore the trailing Wikidot comment &#8212; is equivalent to <tt><span style="white-space: pre-wrap;">[[date</span> <em>timestamp</em> <span style="white-space: pre-wrap;">format=&quot;</span></tt>. Exactly the first <tt><span style="white-space: pre-wrap;">[[date</span> &#8230;]]</tt> part that we need.</li> <li>To implement <tt>{$date_end}</tt> we simply add <tt>date_end=&quot;]]</tt> to the <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt></li> </ul> </li> </ol> <p>At this point our code looks like this:</p> <div class="code"> <pre><code>[[include %%page_unix_name%% page_unix_name=%%page_unix_name%% | page_name=%%page_name%% | author=%%author%% | linked_title=[/%%page_unix_name%% %%title%%] | date_start=%%date|[!--%%--] | date_end=&quot;]] | . . ]]</code></pre></div> <h4><span>Live Template</span></h4> <p>One might think that we've made it: the <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> with all include variables has been defined properly. But &#8230;</p> <p><em>Challenge:</em> The code we wrote isn't recognized as a valid live template.</p> <p><em>Solution:</em> Live templates not only (as documented) must be named <strong>_template</strong> , but (not documented) they also <em>must</em> contain either <tt>%%content%%</tt> or <tt>%%content{<em>number</em>}%%</tt>, where <em>number</em> is a string comprised of digits 0&#8230;9 only.</p> <p>Now, that's a challenge, because we do <em>not</em> want the page content added <em>in addition</em> to our include which already <em>adds</em> the page content.</p> <p>One solution might be to add <tt>%%content{0}%%</tt>, which is sufficient for a template to be recognized as a live template. It will always resolve empty, as actual page section numbers start with one.</p> <p>A different approach would be to add</p> <div class="code"> <pre><code>[!-- %%content%% --]</code></pre></div> <br /> Again this would be enough for a live template to be recognized as such (it doesn't matter that <tt>%%content%%</tt> is surrounded by a Wikidot comment). But be aware that the comments would fail to hide <em>all</em> of the page content, if the content itself contained a Wikidot comment. The comment end tag (<tt><span style="white-space: pre-wrap;">--]</span></tt>) of this comment would then prematurely end the surrounding comment from the above code! <p>For such a case, the Community How-To <a href="http://community.wikidot.com/howto:comment-nested">Nested Comments</a> suggests the following solution:</p> <div class="code"> <pre><code>[!-- [[code]] %%content%% [[/code]] --]</code></pre></div> <p>But for now, let's assume we chose to add <tt>%%content{0}%%</tt> &#8212; this would make our code look like this:</p> <div class="code"> <pre><code>[[include %%page_unix_name%% page_unix_name=%%page_unix_name%% | page_name=%%page_name%% | author=%%author%% | linked_title=[/%%page_unix_name%% %%title%%] | date_start=%%date|[!--%%--] | date_end=&quot;]] | . . ]] %%content{0}%%</code></pre></div> <h4><span>Preview</span></h4> <p>Did we finally make it? Everything working as intended? Unfortunately, no. What happens if &#8212; while editing your page content &#8212; you do a &#8220;preview&#8221; from the editor?</p> <p><em>Challenge:</em> During a &#8220;preview&#8221; just the above <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> code is rendered: as code, and not as the processed include. No page content is shown at all! Our live template designed so far completely breaks &#8220;preview&#8221;.</p> <p><em>Solution:</em> As &#8220;preview&#8221; does not resolve <tt>%%&#8230;%%</tt> page variables of a live template, it will not resolve <tt><span style="white-space: pre-wrap;">[[include&#32;%%page_unix_name%%</span> &#8230;]]</tt> and as such does not show the page content as intended (if you'd <em>save</em> the page, everything worked fine, but we're looking for a solution for &#8220;preview&#8221; mode).</p> <p>We could show the content during preview if we simply added <tt>%%content%%</tt>, but then it would show <em>twice</em> on the <em>saved</em> page: once through the include and a second time because of the added <tt>%%content%%</tt>. So we need a way to display <tt>%%content%%</tt> <em>just during preview</em>. Here is the chosen solution. We add the following code:</p> <div class="code"> <pre><code>[[include %%category%%:_startcomment]] %%content%% [[include %%category%%:_endcomment]]</code></pre></div> <p>Where (within the same category)</p> <table> <tr> <td> <p>page <strong>_startcomment</strong> contains</p> <div class="code"> <p><span style="white-space: pre-wrap;">[!--</span><br /> <span style="white-space: pre-wrap;">[[code]]</span></p> </div> </td> <td style="padding-left:1em"> <p>page <strong>_endcomment</strong> contains</p> <div class="code"> <p><span style="white-space: pre-wrap;">[[/code]]</span><br /> <span style="white-space: pre-wrap;">--]</span></p> </div> </td> </tr> </table> <p>As we saw before, neither <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%:_startcomment]]</span></tt> nor <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%:_endcomment]]</span></tt> is resolved during &#8220;preview&#8221; and page content will be shown &#8212; unfortunately along with the page content those <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%:</span>&#8230;<span style="white-space: pre-wrap;">]]</span></tt> tags will also be shown as plain text.</p> <p>When the page is saved, both <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%:</span>&#8230;<span style="white-space: pre-wrap;">]]</span></tt> will be resolved and will completely comment (and thus remove) <tt>%%comment%%</tt>.</p> <p>Page content is now shown properly both during preview and on the saved page, but as described above we still see <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> code rendered as plain text during preview. Can we remove it? Here's a way: we'll surround the <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> code with</p> <div class="code"> <p><span style="white-space: pre-wrap;">[!--</span><br /> <span style="white-space: pre-wrap;">[[code]]</span><br /> <span style="white-space: pre-wrap;">[[include&#32;%%category%%:_endcomment]]</span></p> </div> <br /> and <div class="code"> <p><span style="white-space: pre-wrap;">[[include&#32;%%category%%:_startcomment]]</span><br /> <span style="white-space: pre-wrap;">[[/code]]</span><br /> <span style="white-space: pre-wrap;">--]</span></p> </div> <br /> We're again applying the idea presented above: the <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%:</span>&#8230;<span style="white-space: pre-wrap;">]]</span></tt> are not resolved during preview and thus the <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> code is commented by the Wikidot comment. When the page is <em>saved</em> the <tt><span style="white-space: pre-wrap;">[[include&#32;%%category%%:</span>&#8230;<span style="white-space: pre-wrap;">]]</span></tt> <em>are</em> resolved and become empty Wikidot comments, leaving the <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> intact. <p>Meanwhile our code looks like this:</p> <div class="code"> <pre><code>[!-- [[code]] [[include %%category%%:_endcomment]] [[include %%page_unix_name%% page_unix_name=%%page_unix_name%% | page_name=%%page_name%% | author=%%author%% | linked_title=[/%%page_unix_name%% %%title%%] | date_start=%%date|[!--%%--] | date_end=&quot;]] | . . ]] [[include %%category%%:_startcomment]] [[/code]] --] [[include %%category%%:_startcomment]] %%content%% [[include %%category%%:_endcomment]]</code></pre></div> <h4><span><a name="user-variables"></a>User Variables</span></h4> <p><em>Challenge:</em> In addition to <em>system</em> variables it may sometimes be desirable to define your own <em>user</em> variable that could be used on the page. If any piece of text or code is to be used multiple times on a page, such user variables may simplify page maintenance as any changes to the common part needs only to be done once.</p> <p><em>Solution:</em> By inserting <tt>%%content{2}%%</tt> to the list of include variables, it is possible to define user variables (in standard include variable syntax, like <tt>width=100px | name=standard.jpg</tt> in a second page section (separated from the main content by a content splitter <tt>====</tt>).</p> <p>Which gives us the final live template code:</p> <div class="code"> <pre><code>[!-- [[code]] [[include %%category%%:_endcomment]] [[include %%page_unix_name%% page_unix_name=%%page_unix_name%% | page_name=%%page_name%% | author=%%author%% | linked_title=[/%%page_unix_name%% %%title%%] | date_start=%%date|[!--%%--] | date_end=&quot;]] | . . %%content{2}%% ]] [[include %%category%%:_startcomment]] [[/code]] --] [[include %%category%%:_startcomment]] %%content%% [[include %%category%%:_endcomment]]</code></pre></div> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span></p> <div class="footnotes-footer"> <div class="title">Footnotes</div> <div class="footnote-footer" id="footnote-887237-1"><a href="javascript:;" >1</a>. There's a disadvantage in this approach: if %%title% is empty, this link breaks</div> </div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:include-inline</guid>
				<title>Include Inline</title>
				<link>http://community.wikidot.com/howto:include-inline</link>
				<description>

&lt;p&gt;As implemented, the &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;]]&lt;/span&gt;&lt;/tt&gt; tag allows to include a block of text as separate lines or paragraphs, but does not allow to include text &amp;#8220;inline,&amp;#8221; i. e. &lt;em&gt;within&lt;/em&gt; a single line.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sat, 21 Mar 2009 11:57:08 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>As implemented, the <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;<span style="white-space: pre-wrap;">]]</span></tt> tag allows to include a block of text as separate lines or paragraphs, but does not allow to include text &#8220;inline,&#8221; i. e. <em>within</em> a single line.</p> <p>There have been quite some discussions if and how such an &#8220;inline include&#8221; could be done. Here is a workaround how to do it.</p> <h2><span>Step by Step</span></h2> <h4><span>Step 1</span></h4> <p>Create your <strong>included</strong> page with</p> <ol> <li>a leading comment (<tt><span style="white-space: pre-wrap;">[!----]</span></tt>) and</li> <li>a trailing backslash (<tt><span style="white-space: pre-wrap;">\</span></tt>)</li> </ol> <p>e. g.</p> <div class="code"> <pre><code>[!----]included //inline// and **may** contain formatting\</code></pre></div> <h4><span>Step 2</span></h4> <p>Create your <strong>include</strong> statement with</p> <ol> <li>a trailing backslash (<tt><span style="white-space: pre-wrap;">\</span></tt>) added to the text that goes <em>before</em> the inline include, and</li> <li>a leading comment (<tt><span style="white-space: pre-wrap;">[!----]</span></tt>) before the text that goes <em>after</em> the inline include</li> </ol> <p>e. g.</p> <div class="code"> <p><span style="white-space: pre-wrap;">Text&#32;can&#32;be&#32;\</span><br /> <span style="white-space: pre-wrap;">[[include&#32;inc]]</span><br /> <span style="white-space: pre-wrap;">[!----]&#32;tags&#32;as&#32;you&#32;like</span></p> </div> <h2><span><a name="examples"></a>Examples</span></h2> <table style="border-collapse:collapse;border-top:2px solid;border-bottom:2px solid"> <tr> <td style="padding:3px 1em 3px 0"><em><strong>What you type &#8230;</strong></em></td> <td><em><strong>What you get &#8230;</strong></em></td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <p><span style="white-space: pre-wrap;">Text&#32;can&#32;be&#32;\</span><br /> <span style="white-space: pre-wrap;">[[include&#32;inc]]</span><br /> <span style="white-space: pre-wrap;">[!----]&#32;tags&#32;as&#32;you&#32;like</span></p> </div> </td> <td>Text can be included <em>inline</em> and <strong>may</strong> contain formatting tags as you like</td> </tr> </table> <h2><span>How it Works</span></h2> <p>As an <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;<span style="white-space: pre-wrap;">]]</span></tt> introduces <em>two</em> consecutive line breaks both <em>before</em> and <em>after</em> the include, a way to remove those two line breaks is:</p> <ol> <li>remove the first line break by appending a trailing backslash (&#8220;\&#8221;) to the line preceding the two line breaks, and</li> <li>remove the second line break by prepending a leading Wikidot comment (<tt><span style="white-space: pre-wrap;">[!----]</span></tt>) to the line following the two line breaks (similar to how a trailing &#8220;\&#8221; removes the <em>following</em> line break, a leading comment will remove the <em>previous</em> line break).</li> </ol> <h2><span>Backlinks</span></h2> <h2><span>Author</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:erichsteinboeck">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/inc:include-inline</guid>
				<title>Include Inline</title>
				<link>http://community.wikidot.com/inc:include-inline</link>
				<description>

&lt;p&gt;included &lt;em&gt;inline&lt;/em&gt; and &lt;strong&gt;may&lt;/strong&gt; contain formatting&lt;br /&gt;
by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sat, 21 Mar 2009 11:56:46 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>included <em>inline</em> and <strong>may</strong> contain formatting<br /> by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/blog:new-home-page-created-with-live-template</guid>
				<title>New Home Page Created With &quot;Live&quot;-Template</title>
				<link>http://community.wikidot.com/blog:new-home-page-created-with-live-template</link>
				<description>

&lt;p&gt;I created a new Front Page for the community called &amp;quot;home:home1&amp;quot; page using a &amp;quot;live&amp;quot; _template with 10 &amp;quot;content&amp;quot; holders and some standard includes with layout def&#039;s and in a second level includes with header and content of the single blocks.&lt;br /&gt;
I got the idea from &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/phil-chett&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=4297&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;Phil Chett&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=4297)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/phil-chett&quot;  &gt;Phil Chett&lt;/a&gt;&lt;/span&gt;&#039;s &lt;a href=&quot;http://psc.wikidot.com/blog:a-module-and-front-page-creator&quot; target=&quot;_blank&quot;&gt;blog&lt;/a&gt; about his thinking over a better &amp;quot;block&amp;quot; or &amp;quot;module&amp;quot; system for a &amp;quot;Front&amp;quot; page.&lt;/p&gt;
&lt;p&gt;Please - have a look on the codes of our new &amp;quot;front&amp;quot; page and it&#039;s used &lt;a href=&quot;http://community.wikidot.com/home:_template&quot; target=&quot;_blank&quot;&gt;home:_template&lt;/a&gt; !&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/helmut-pdorf&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=17609&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;Helmut_pdorf&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=17609)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/helmut-pdorf&quot;  &gt;Helmut_pdorf&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sat, 14 Feb 2009 18:15:00 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>I created a new Front Page for the community called &quot;home:home1&quot; page using a &quot;live&quot; _template with 10 &quot;content&quot; holders and some standard includes with layout def's and in a second level includes with header and content of the single blocks.<br /> I got the idea from <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/phil-chett" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=4297&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="Phil Chett" style="background-image:url(http://www.wikidot.com/userkarma.php?u=4297)" /></a><a href="http://www.wikidot.com/user:info/phil-chett" >Phil Chett</a></span>'s <a href="http://psc.wikidot.com/blog:a-module-and-front-page-creator" target="_blank">blog</a> about his thinking over a better &quot;block&quot; or &quot;module&quot; system for a &quot;Front&quot; page.</p> <p>Please - have a look on the codes of our new &quot;front&quot; page and it's used <a href="http://community.wikidot.com/home:_template" target="_blank">home:_template</a> !</p> <div class="content-separator" style="display: none:"></div> <p>Notice: I have inserted a blank before every include tag to stop the insertion of their content ! :)</p> <div class="collapsible-block"> <div class="collapsible-block-folded"><a class="collapsible-block-link" href="javascript:;">&gt;&gt;&nbsp;show&nbsp;the&nbsp;home:home1&nbsp;page&nbsp;code</a></div> <div class="collapsible-block-unfolded" style="display:none"> <div class="collapsible-block-unfolded-link"><a class="collapsible-block-link" href="javascript:;">&gt;&gt;&nbsp;hide&nbsp;the&nbsp;home:home1&nbsp;page&nbsp;code</a></div> <div class="collapsible-block-content"> <div class="code"> <pre><code>[!-- ********* Welcome header**************** --] [!-- ****************left cell******************* --] [!-- --] [[include include:mod_layout1 called_include=include:welcome-left]] [!-- --] ==== [!-- ****************Right cell******************* --] [!-- --] [[include include:mod_layout1 called_include=include:welcome-right]] [!-- --] [!-- ********* End of Welcome header**************** --] [!-- --] ==== [!-- ********* Start Page-&quot;complete&quot; table**************** --] [!-- --] [!-- ****************left Column******************* --] [!-- --] [!-- *************Help New to Wikidot? Get Help ****************** --] [!-- --] [[include include:mod_layout2 called_include=include:New-to-Wikidot | header=New to Wikidot? Get Help]] [!-- --] ==== [!-- *************Latest Wikidot.com News ****************** --] [!-- --] [[include include:mod_layout2 called_include=include:Latest-Wikidot-com-News | header=Latest **[*http://www.wikidot.com/ Wikidot.com]** News]] [!-- --] ==== [!-- *************Latest Community News ****************** --] [!-- --] [[include include:mod_layout2 called_include=include:Latest-Community-News | header=Latest Community News]] [!-- --] ==== [!-- ************* Keep Informed ***************** --] [!-- --] [[include include:mod_layout2 called_include=include:Keep-Informed | header=Keep Informed]] [!-- --] [!-- *************End of LEFT COLUMN******************* --] [!-- --] [!-- --] ==== [!-- ****************Right COLUMN******************* --] [!-- --] [!-- --] [!-- ************* How Do I ***************** --] [!-- --] [[include include:mod_layout2 called_include=include:How-Do-I | header=How Do I ]] [!-- --] ==== [!-- ************ Small faetured**************** --] [!-- --] [[include include:mod_layout2 called_include=include:Small-faetured-site | header=Featured Site]] [!-- --] ==== [!-- *************You help****************** --] [!-- --] [[include include:mod_layout2 called_include=include:You-help | header=Things YOU can help with]] [!-- --] ==== [!-- *************Forum Activity ************** --] [!-- --] [[include include:mod_layout2 called_include=include:Forum-Activity | header=[*http://community.wikidot.com/forum:recent-posts Latest Forum Activity &gt;&gt;&gt;] ]] [!-- --] ==== [!-- --] [!-- ****************End Right Column ******************* --] [!-- --] [!-- ****************End Page-&quot;complete&quot; table ******************* --]</code></pre></div> </div> </div> </div> <p><br /></p> <div class="collapsible-block"> <div class="collapsible-block-folded"><a class="collapsible-block-link" href="javascript:;">&gt;&gt;&nbsp;show&nbsp;the&nbsp;home:_template&nbsp;&nbsp;page&nbsp;code</a></div> <div class="collapsible-block-unfolded" style="display:none"> <div class="collapsible-block-unfolded-link"><a class="collapsible-block-link" href="javascript:;">&gt;&gt;&nbsp;hide&nbsp;the&nbsp;home:_template&nbsp;page&nbsp;code</a></div> <div class="collapsible-block-content"> <div class="code"> <pre><code>[!-- ********* Welcome header**************** --] [[table style=&quot;width:98%&quot;]] [[row]] [[cell style=&quot;padding-right: 20px; border: 0px solid silver; width: 72%; vertical-align: top&quot;]] [!-- ****************left cell******************* --] [!-- --] %%content{1}%% [[/cell]] [!-- ****************Right cell******************* --] [[cell style=&quot;padding:1px; border: 0px solid silver;width:28%; vertical-align: top&quot;]] %%content{2}%% [[/cell]] [[/row]] [[/table]] [!-- ********* End of Welcome header**************** --] [!-- --] [!-- ********* Start Page-&quot;complete&quot; table**************** --] [[table style=&quot;width:98%&quot;]] [[row]] [[cell style=&quot;padding-right: 20px; border: 0px solid silver; width: 62%; vertical-align: top&quot;]] [!-- ****************left Column******************* --] [!-- --] [!-- --] [!-- *************Help New to Wikidot? Get Help ****************** --] %%content{3}%% [!-- *************Latest Wikidot.com News ****************** --] %%content{4}%% [!-- *************Latest Community News ****************** --] %%content{5}%% [!-- ************* Keep Informed ***************** --] %%content{6}%% [!-- *************End of LEFT COLUMN******************* --] [[/cell]] [!-- --] [!-- --] [!-- ****************Right COLUMN******************* --] [[cell style=&quot;padding:1px; border: 0px solid silver;width:38%; vertical-align: top&quot;]] [!-- --] [!-- --] [!-- ************* How Do I ***************** --] %%content{7}%% [!-- ************New Small faetured**************** --] %%content{8}%% [!-- *************You help****************** --] %%content{9}%% [!-- *************Forum Activity ************** --] %%content{10}%% [!-- --] [!-- --] [[/cell]] [!-- ****************End Right Column ******************* --] [[/row]] [[/table]] [!-- ****************End Page-&quot;complete&quot; table ******************* --] ===== [!-- ********* Welcome header**************** --] [!-- ****************left cell******************* --] [!-- --] [[include include:mod_layout1 called_include=include:welcome-left]] [!-- --] ==== [!-- ****************Right cell******************* --] [!-- --] [[include include:mod_layout1 called_include=include:welcome-right]] [!-- --] [!-- ********* End of Welcome header**************** --] [!-- --] ==== [!-- ********* Start Page-&quot;complete&quot; table**************** --] [!-- --] [!-- ****************left Column******************* --] [!-- --] [!-- *************Help New to Wikidot? Get Help ****************** --] [!-- --] [[include include:mod_layout2 called_include=include:New-to-Wikidot | header=New to Wikidot? Get Help]] [!-- --] ==== [!-- *************Latest Wikidot.com News ****************** --] [!-- --] [[include include:mod_layout2 called_include=include:Latest-Wikidot-com-News | header=Latest **[*http://www.wikidot.com/ Wikidot.com]** News]] [!-- --] ==== [!-- *************Latest Community News ****************** --] [!-- --] [[include include:mod_layout2 called_include=include:Latest-Community-News | header=Latest Community News]] [!-- --] ==== [!-- ************* Keep Informed ***************** --] [!-- --] [[include include:mod_layout2 called_include=include:Keep-Informed | header=Keep Informed]] [!-- --] [!-- *************End of LEFT COLUMN******************* --] [!-- --] [!-- --] ==== [!-- ****************Right COLUMN******************* --] [!-- --] [!-- --] [!-- ************* How Do I ***************** --] [!-- --] [[include include:mod_layout2 called_include=include:How-Do-I | header=How Do I ]] [!-- --] ==== [!-- ************ Small faetured**************** --] [!-- --] [[include include:mod_layout2 called_include=include:Small-faetured-site | header=Featured Site]] [!-- --] ==== [!-- *************You help****************** --] [!-- --] [[include include:mod_layout2 called_include=include:You-help | header=Things YOU can help with]] [!-- --] ==== [!-- *************Forum Activity ************** --] [!-- --] [[include include:mod_layout2 called_include=include:Forum-Activity | header=[*http://community.wikidot.com/forum:recent-posts Latest Forum Activity &gt;&gt;&gt;] ]] [!-- --] ==== [!-- --] [!-- ****************End Right Column ******************* --] [!-- --] [!-- ****************End Page-&quot;complete&quot; table ******************* --]</code></pre></div> </div> </div> </div> <h3><span>in Action the Template:</span></h3> <p><a href="http://community.wikidot.com/home:_template" target="_blank">http://community.wikidot.com/home:_template</a></p> <h3><span>Permissions:</span></h3> <p>I changed the permissions in the Site manager for the &quot;home:&quot; category only allowed to edit for admins.</p> <p>I let the include: boxes editable for all members of the site&#8230;</p> <p>To-Do: the re-parenting of all sub pages ( childs) from the old start page.</p> <p>( I had not changed the old start page - we can always go back in the general settings.)</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/helmut-pdorf" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=17609&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="Helmut_pdorf" style="background-image:url(http://www.wikidot.com/userkarma.php?u=17609)" /></a><a href="http://www.wikidot.com/user:info/helmut-pdorf" >Helmut_pdorf</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/blog:databases-on-wikidot</guid>
				<title>Databases On Wikidot (old)</title>
				<link>http://community.wikidot.com/blog:databases-on-wikidot</link>
				<description>

&lt;p&gt;I created a little database on our Community site relating to the &amp;quot;showcase&amp;quot; &lt;a class=&quot;newpage&quot; href=&quot;http://community.wikidot.com/database&quot;&gt;database&lt;/a&gt;.&lt;br /&gt;
I used the&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://community.wikidot.com/help:autonumbering-of-pages&quot;&gt;help:autonumbering-of-pages&lt;/a&gt; feature for unique &amp;quot;primary keys per row&#039;s of the 2 categories (&amp;quot;db1country:&amp;quot;, &amp;quot;db1town:&amp;quot;),&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;newpage&quot; href=&quot;http://community.wikidot.com/include:db1country&quot;&gt;include:db1country&lt;/a&gt; for record insertion with &amp;quot;short source code in table &amp;quot;db1country&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;newpage&quot; href=&quot;http://community.wikidot.com/include:db1town&quot;&gt;include:db1town&lt;/a&gt; for record insertion ijn the 2 table db2town&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;newpage&quot; href=&quot;http://community.wikidot.com/db1country:_template&quot;&gt;db1country:_template&lt;/a&gt; for showing and creating records over prepared newpage modules&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;newpage&quot; href=&quot;http://community.wikidot.com/db1town:_template&quot;&gt;db1town:_template&lt;/a&gt; for showing and creating records in the town table&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/helmut-pdorf&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=17609&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;Helmut_pdorf&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=17609)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/helmut-pdorf&quot;  &gt;Helmut_pdorf&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 06 Jan 2009 15:57:30 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>I created a little database on our Community site relating to the &quot;showcase&quot; <a class="newpage" href="http://community.wikidot.com/database">database</a>.<br /> I used the</p> <ul> <li><a href="http://community.wikidot.com/help:autonumbering-of-pages">help:autonumbering-of-pages</a> feature for unique &quot;primary keys per row's of the 2 categories (&quot;db1country:&quot;, &quot;db1town:&quot;),</li> <li><a class="newpage" href="http://community.wikidot.com/include:db1country">include:db1country</a> for record insertion with &quot;short source code in table &quot;db1country&quot;</li> <li><a class="newpage" href="http://community.wikidot.com/include:db1town">include:db1town</a> for record insertion ijn the 2 table db2town</li> <li><a class="newpage" href="http://community.wikidot.com/db1country:_template">db1country:_template</a> for showing and creating records over prepared newpage modules</li> <li><a class="newpage" href="http://community.wikidot.com/db1town:_template">db1town:_template</a> for showing and creating records in the town table</li> </ul> <div class="content-separator" style="display: none:"></div> <p>- for Links &quot;between the 2 tables&quot; I used the</p> <ul> <li>&quot;interwiki&quot; technic ( <span style="white-space: pre-wrap;">[/page-name&#32;showname]</span> in the variables of the &quot;includes&quot; -</li> <li>this prevents us of the &quot;breaking&quot; pipe in the link and the &quot;breaking&quot; 3 brackets..</li> </ul> <p>I am awaiting your Comments!<br /> regards<br /> Helmut</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/helmut-pdorf" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=17609&amp;amp;size=small&amp;amp;timestamp=1778818750" alt="Helmut_pdorf" style="background-image:url(http://www.wikidot.com/userkarma.php?u=17609)" /></a><a href="http://www.wikidot.com/user:info/helmut-pdorf" >Helmut_pdorf</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:redirect-a-complete-category</guid>
				<title>Redirect a complete category</title>
				<link>http://community.wikidot.com/howto:redirect-a-complete-category</link>
				<description>

&lt;h1&gt;&lt;span&gt;Mass redirection from a bad-named-category to a new one&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=3370&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818750&quot; alt=&quot;gerdami&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=3370)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;gerdami&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 28 Nov 2008 09:27:42 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h1><span>Mass redirection from a bad-named-category to a new one</span></h1> <h2><span>New instructions</span></h2> <p>1. Read carefully the <a href="http://www.wikidot.com/doc:redirect-module">Redirect module documentation</a></p> <p>2. Write down this URL address for recovery purpose:</p> <blockquote> <p><span style="white-space: pre-wrap;">http://yoursite.wikidot.com/bad-named-category:_template/noredirect/true</span></p> </blockquote> <p>3. Create a <strong>bad-named-category:_template</strong> with the following content:</p> <blockquote> <p><span style="white-space: pre-wrap;">[[module&#32;Redirect&#32;destination=&quot;new-category:%%page_name%%&quot;]]</span></p> </blockquote> <p><span style="text-decoration: line-through;">Note that <span style="white-space: pre-wrap;">%%content%%&#32;</span> is necessary to <em>activate</em> the variable <span style="white-space: pre-wrap;">%%page_name%%</span></span></p> <p>Hence a <strong>bad-named-category:page1</strong> would be redirected to <strong>new-category:page1</strong></p> <div class="collapsible-block"> <div class="collapsible-block-folded"><a class="collapsible-block-link" href="javascript:;">+&nbsp;show&nbsp;me&nbsp;the&nbsp;old&nbsp;version</a></div> <div class="collapsible-block-unfolded" style="display:none"> <div class="collapsible-block-unfolded-link"><a class="collapsible-block-link" href="javascript:;">-&nbsp;hide&nbsp;this&nbsp;old&nbsp;version</a></div> <div class="collapsible-block-content"> <blockquote> <p>Caution: the code below might be dangerous when applied to the default category.</p> </blockquote> <h2><span>Instructions</span></h2> <p>1. Create the page <strong>include:redirect</strong> with the following content:</p> <blockquote> <p><span style="white-space: pre-wrap;">[!--</span><br /> <span style="white-space: pre-wrap;">[[module</span> Redirect destination=&quot;{$newcategory}:{$pagename}&quot;]]<br /> <span style="white-space: pre-wrap;">--]</span><br /> <span style="white-space: pre-wrap;">----</span><br /> module Redirect destination=&quot;{$newcategory}:{$pagename}&quot;</p> </blockquote> <p>Note the <span style="white-space: pre-wrap;">[!--&#32;...&#32;&#32;--]</span> to prevent early redirection, i.e. when everything not ready&#8230; the last line will display what to be redirected and where if module was not &quot;commented&quot;.</p> <p>2. Create a <strong>bad-named-category:_template</strong> with the following content:</p> <blockquote> <p><span style="white-space: pre-wrap;">[[include</span> include:redirect newcategory=nice-category | pagename=%%page_name%% ]]</p> </blockquote> <p>Hence a <strong>bad-named-category:page1</strong> would be redirected to <strong>nice-category:page1</strong></p> <p>With the <em>commented</em> module, you can preview the redirection.<br /> When everything is OK, edit again the <strong>include:redirect</strong> page and remove the comment <strong><span style="white-space: pre-wrap;">[!--</span></strong></p> <p>If you want to edit again the redirected pages, you have first to</p> <ul> <li>reedit the <strong>include:redirect</strong> with <span style="white-space: pre-wrap;">http</span>://your-wiki.wikidot.com/<strong>include:redirect</strong>/noredirect/true</li> <li>and revert to previous version via the page history (add a comment redirect=true / false)</li> <li>edit the redirected page(s)</li> </ul> <h2><span>Resources involved</span></h2> <ul> <li><a href="http://www.wikidot.com/doc:wiki-syntax#toc38">include</a></li> <li><a href="http://www.wikidot.com/doc:templates">_template and variables</a></li> <li><a href="http://www.wikidot.com/doc:redirect-module">module redirect</a></li> </ul> <h2><span>Disclaimer</span></h2> <blockquote> <p>We cannot accept complaints from Wikidot dummies if they cannot access their pages anymore.</p> </blockquote> </div> </div> </div> <h2><span>Author</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/gerdami" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=3370&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="gerdami" style="background-image:url(http://www.wikidot.com/userkarma.php?u=3370)" /></a><a href="http://www.wikidot.com/user:info/gerdami" >gerdami</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:gerdami">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/gerdami" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=3370&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="gerdami" style="background-image:url(http://www.wikidot.com/userkarma.php?u=3370)" /></a><a href="http://www.wikidot.com/user:info/gerdami" >gerdami</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/wishlist:43</guid>
				<title>Page-specified ListPages</title>
				<link>http://community.wikidot.com/wishlist:43</link>
				<description>

&lt;h1&gt;&lt;span&gt;Description&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/govegan&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=35113&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;GoVegan&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=35113)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/govegan&quot;  &gt;GoVegan&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Wed, 26 Nov 2008 03:14:56 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h1><span>Description</span></h1> <p>The ListPages module provides fantastic functionality.</p> <p>I want to use this functionality for one particular page though. That is, I want to include elements of a particular page.</p> <p>Currently, I have been using a workaround in which you give the particular page a UNIQUE tag, and hence we can identify only that page. However for obvious reasons this method becomes very tedious.</p> <p>I wish you could specify a particular page in the ListPages module:</p> <blockquote> <p><span style="white-space: pre-wrap;">[[module&#32;ListPages&#32;page=&quot;selected-page&quot;]]</span></p> </blockquote> <p>Using such an attribute would need to void a few other attributes (or vice versa) such as:</p> <ul> <li>category=</li> <li>tags=</li> </ul> <p>But I still feel that this is a very useful technique that should be implemented.</p> <h2><span>Links to forum Posts</span></h2> <p>This wish comes verbatim from <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/james-kanjo" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7932347&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="James Kanjo" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7932347)" /></a><a href="http://www.wikidot.com/user:info/james-kanjo" >James Kanjo</a></span>'s post at <a href="http://pro.wikidot.com/ticket:148" target="_blank">Pro ;)</a></p> <hr /> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/govegan" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=35113&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="GoVegan" style="background-image:url(http://www.wikidot.com/userkarma.php?u=35113)" /></a><a href="http://www.wikidot.com/user:info/govegan" >GoVegan</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:include-variables-with-special-characters</guid>
				<title>Include Variables with Special Characters</title>
				<link>http://community.wikidot.com/howto:include-variables-with-special-characters</link>
				<description>

&lt;p&gt;The &lt;tt&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&lt;/span&gt; &amp;#8230;]]&lt;/tt&gt; tag allows to specify &lt;em&gt;include variables&lt;/em&gt; &amp;#8212; placeholders, together with arbitrary text strings (the include variable&#039;s value) that will replace them on the included page.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=3370&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;gerdami&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=3370)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;gerdami&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 20 Nov 2008 11:32:59 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <p>The <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> tag allows to specify <em>include variables</em> &#8212; placeholders, together with arbitrary text strings (the include variable's value) that will replace them on the included page.</p> <p>Although, in general, include variable values may contain any character, some characters may be challenging to enter.</p> <h2><span>Closing Brackets</span></h2> <p>If you follow the <a href="http://www.wikidot.com/doc:wiki-syntax#include">inc example</a> in the Wikidot syntax documentation</p> <div class="code"> <pre><code>[[include pagename var1=value1 | number_books = 43 | title=Best Wiki Ever | variable_name = just a variable | variableName = another variable ]]</code></pre></div> <p>and try to add an include variable whose value ends in two (or more) closing brackets (like <tt><span style="white-space: pre-wrap;">[[size&#32;smaller]]Text&#32;to&#32;display[[/size]]</span></tt>) with this code</p> <div class="code"> <p><span style="white-space: pre-wrap;">[[include&#32;pagename&#32;var1=value1&#32;|&#32;number_books&#32;=&#32;43&#32;|&#32;title=Best&#32;Wiki&#32;Ever</span><br /> <span style="white-space: pre-wrap;">|&#32;variable_name&#32;=&#32;just&#32;a&#32;variable</span><br /> <span style="white-space: pre-wrap;">|&#32;variableName&#32;=&#32;another&#32;variable</span><br /> <strong><span style="white-space: pre-wrap;">|&#32;text&#32;=&#32;[[size&#32;smaller]]Text&#32;to&#32;display[[/size]]</span></strong><br /> <span style="white-space: pre-wrap;">]]</span></p> </div> <p>it will fail. Consecutive closing brackets <strong>at the very end</strong> of an include statement's line will end the include.</p> <p>Most of the time you can avoid having consecutive closing brackets at the end of a line, by moving the pipe (&#8220;|&#8221;) symbols (that are separating adjacent include variables) to the end of the line. In the case of the last (or only ) include variable in an include, you can either</p> <ul> <li>move the two closing brackets (that end the include) to the end of the line, or</li> <li>add a pipe (&#8220;|&#8221;) symbol after the last (or only) include variable (additional pipe symbols do not hurt)</li> </ul> <p>Thus a working code would look like this:</p> <div class="code"> <p><span style="white-space: pre-wrap;">[[include&#32;pagename&#32;var1=value1&#32;|&#32;number_books&#32;=&#32;43&#32;|&#32;title=Best&#32;Wiki&#32;Ever</span> <strong>|</strong><br /> <span style="white-space: pre-wrap;">variable_name&#32;=&#32;just&#32;a&#32;variable</span> <strong>|</strong><br /> <span style="white-space: pre-wrap;">variableName&#32;=&#32;another&#32;variable</span> <strong>|</strong><br /> <span style="white-space: pre-wrap;">text&#32;=&#32;[[size&#32;smaller]]Text&#32;to&#32;display[[/size]]</span> <strong>]]</strong></p> </div> <h5><span>Cannot Move Pipe Symbol to Line End</span></h5> <p>In case you cannot move a pipe symbol to the end of the line, because the Wikidot syntax requires you to write a tag on its own line (<tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt> is an example) here's a workaround.</p> <p>Let's assume you want the value of an include variable to be the following (the <em>value</em> itself should contain another <tt><span style="white-space: pre-wrap;">[[include</span> &#8230;]]</tt>):</p> <div class="code"> <p>Text before include<br /> <span style="white-space: pre-wrap;">[[include&#32;boilerplate]]</span><br /> Text after include</p> </div> <p>Coding</p> <div class="code"> <p><span style="white-space: pre-wrap;">[[include&#32;pagename</span><br /> text=Text before include<br /> <span style="white-space: pre-wrap;">[[include&#32;boilerplate]]</span><br /> Text after include<br /> <span style="white-space: pre-wrap;">]]</span></p> </div> <p>would fail (as the <tt><span style="white-space: pre-wrap;">[[include&#32;boilerplate]]</span></tt>'s closing brackets end the outer include). Instead you might use:</p> <div class="code"> <p><span style="white-space: pre-wrap;">[[include&#32;pagename</span><br /> text=Text before include<br /> <span style="white-space: pre-wrap;">[[include&#32;boilerplate{$br}]</span><br /> Text after include |<br /> <span style="white-space: pre-wrap;">br=]</span><br /> <span style="white-space: pre-wrap;">]]</span></p> </div> <h2><span>Pipe Symbol</span></h2> <p>An even bigger challenge poses the pipe symbol (&#8220;|&#8221;).</p> <p>If you try to add an include variable whose value contains an internal link (like <tt><span style="white-space: pre-wrap;">[[[page|link&#32;text&#32;to&#32;show]]]</span></tt>) with the code</p> <div class="code"> <p><span style="white-space: pre-wrap;">[[include&#32;pagename&#32;var1=value1&#32;|&#32;number_books&#32;=&#32;43&#32;|&#32;title=Best&#32;Wiki&#32;Ever</span><br /> <span style="white-space: pre-wrap;">|&#32;variable_name&#32;=&#32;just&#32;a&#32;variable</span><br /> <span style="white-space: pre-wrap;">|&#32;variableName&#32;=&#32;another&#32;variable</span><br /> <strong><span style="white-space: pre-wrap;">|&#32;link&#32;=&#32;[[[page|link&#32;text&#32;to&#32;show]]]</span></strong><br /> <span style="white-space: pre-wrap;">]]</span></p> </div> <br /> it will again fail. The pipe symbol within the internal link is interpreted as an include variable separator so that the value of &#8220;link&#8221; becomes <tt><span style="white-space: pre-wrap;">[[[page</span></tt> only. <p>There is no general solution how to include a pipe symbol in an include variable value, but for special cases there are workarounds.</p> <h5><span>Rewrite Internal Link</span></h5> <p>To avoid having to use a pipe symbol in an internal link, rewrite the link in the alternate format.</p> <div class="code"> <pre><code>[/page link text to show]</code></pre></div> <br /> Note that for the alternate format the link text is <em>mandatory,</em> whereas for the standard internal link format the link text is <em>optional,</em> so for some cases this workaround introduces an incompatibility. <h5><span>Include a Page with Pipe Symbol</span></h5> <p>Here's another idea:</p> <div class="code"> <pre><code>[[include pagename link=[[[page [[include :csi:pipe]{$br} | link text to show]]] | br=] ]]</code></pre></div> <br /> which includes <a href="http://csi.wikidot.com/pipe">this page</a> (containing a single &#8220;|&#8221; symbol) <h2><span>Backlinks</span></h2> <h2><span>Author</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:erichsteinboeck">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/gerdami" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=3370&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="gerdami" style="background-image:url(http://www.wikidot.com/userkarma.php?u=3370)" /></a><a href="http://www.wikidot.com/user:info/gerdami" >gerdami</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/blog:multilingual-wikidot-site-the-missing-puzzle-piece</guid>
				<title>Multilingual wikidot site - the missing puzzle piece</title>
				<link>http://community.wikidot.com/blog:multilingual-wikidot-site-the-missing-puzzle-piece</link>
				<description>

&lt;h2&gt;&lt;span&gt;Last night, &lt;em&gt;I had a dream&lt;/em&gt;.&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;That&#039;s true.&lt;/p&gt;
&lt;p&gt;I have dreamed about improving the &lt;a href=&quot;http://handbook.wikidot.com&quot;&gt;handbook.wikidot.com&lt;/a&gt; by using the live templates, instead of using [[include]]. The dream could come to reality if the wikidot developer team could provide me with the &lt;a href=&quot;http://www.wikidot.com/doc:templates/comments/show#post-308734&quot;&gt;missing puzzle piece&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=3370&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;gerdami&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=3370)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;gerdami&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 14 Nov 2008 20:07:09 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h2><span>Last night, <em>I had a dream</em>.</span></h2> <p>That's true.</p> <p>I have dreamed about improving the <a href="http://handbook.wikidot.com">handbook.wikidot.com</a> by using the live templates, instead of using [[include]]. The dream could come to reality if the wikidot developer team could provide me with the <a href="http://www.wikidot.com/doc:templates/comments/show#post-308734">missing puzzle piece</a>.</p> <div class="content-separator" style="display: none:"></div> <h2><span>Back to last year</span></h2> <p>Last year, <span class="error-inline"><em>helmuti_pdorf</em> does not match any existing user name</span>, <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/hartnell" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=10978&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="hartnell" style="background-image:url(http://www.wikidot.com/userkarma.php?u=10978)" /></a><a href="http://www.wikidot.com/user:info/hartnell" >hartnell</a></span>, <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/phil-chett" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=4297&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="Phil Chett" style="background-image:url(http://www.wikidot.com/userkarma.php?u=4297)" /></a><a href="http://www.wikidot.com/user:info/phil-chett" >Phil Chett</a></span> and I, started the <a href="http://handbook.wikidot.com">handbook.wikidot.com</a>, the first multilingual wikidot website, at least as regards the content.<br /> The trick, I called the <a href="http://handbook.wikidot.com/en:magic-language-navigation">Magic Language Navigation</a>, was based on includes. Each page had to include the following:</p> <blockquote> <p><span style="white-space: pre-wrap;">[[include&#32;inc:languages&#32;pagename=NewPageNameHerePlease]]</span><br /> <span style="white-space: pre-wrap;">----</span></p> </blockquote> <p>while the content of <strong>include:languages</strong> was</p> <div class="code"> <pre><code>[[=]] [[[de:{$pagename}|Deutsch]]], [[[en:{$pagename}|English]]], [[[es:{$pagename}|Español]]], [[[fr:{$pagename}|Français]]], [[[pl:{$pagename}|Polish]]] [[/=]]</code></pre></div> <p>Unfortunately, the user had to patch the word <em>NewPageNameHerePlease</em> by the current name of the page, with the convention that the page name would be in English for all languages (fr:start, en:start, de:start, it:start, &#8230;)</p> <p>When previewing the page with the Page module, the words &quot;Deutsch - Chinese - English - Español - Français - Italiano - Japanese - Nederlands - Polski - Português - Türkçe&quot; were displayed. I once wrote this post <a href="http://community.wikidot.com/forum/t-15533/hide-mister-hyde-hide">((hide)) Mister Hyde /((hide))</a> but without acknowledge.</p> <h2><span>Now with the live templates</span></h2> <p>The advantage with the live templates is that elements other that %%content%% are not displayed with the [[ListPages]] module. Hence the request for hiding something is less urgent.</p> <h3><span>In action !!!</span></h3> <p>Have a look at page <a class="newpage" href="http://community.wikidot.com/en:test">en:test</a> whose live template is <strong>en:_template</strong><sup class="footnoteref"><a id="footnoteref-350065-1" href="javascript:;" class="footnoteref" >1</a></sup>with the following content:</p> <blockquote> <p><span style="white-space: pre-wrap;">[[div&#32;style=&quot;float:right;&#32;width:&#32;80px;&#32;border:&#32;1px&#32;solid&#32;#999;&#32;margin:&#32;0px;&#32;text-align:center&quot;]]</span><br /> Page also available in<br /> <span style="white-space: pre-wrap;">[[include&#32;inc:languages&#32;pagename=%%page_unix_name%%]]</span><br /> <span style="white-space: pre-wrap;">[[/div]]</span><br /> <span style="white-space: pre-wrap;">%%content%%</span></p> </blockquote> <p>&#8230; while the <strong>include:languages</strong> page contains:</p> <div class="code"> <pre><code>[[[de:{$pagename}|Deutsch]]] [[[en:{$pagename}|English]]] [[[fr:{$pagename}|Français]]]</code></pre></div> <br /> &#8230; flag version <div class="code"> <pre><code>[[table]] [[row]] [[cell]] [[[de:{$pagename}|de]]] [[/cell]] [[cell]] [[image /include:languages/de.gif link=&quot;de:{$pagename}&quot;]] [[/cell]] [[/row]] [[row]] [[cell]] [[[en:{$pagename}|en]]] [[/cell]] [[cell]] [[image /include:languages/en.gif link=&quot;en:{$pagename}&quot;]] [[/cell]] [[/row]] [[row]] [[cell]] [[[fr:{$pagename}|fr]]] [[/cell]] [[cell]] [[image /include:languages/fr.gif link=&quot;fr:{$pagename}&quot;]] [[/cell]] [[/row]] [[/table]]</code></pre></div> <br /> The variable $pagename is replaced at display time by the %%page_unix_name%% of the current page. <p>If you look at page <a class="newpage" href="http://community.wikidot.com/fr:test">fr:test</a> and hover the mouse over the language links to the right, you will see:</p> <blockquote> <p>de:<strong>fr</strong>:test<br /> en:<strong>fr</strong>:test<br /> fr:<strong>fr</strong>:test</p> </blockquote> <p><strong>Failed !</strong> but close to the goal.</p> <p>Why ? Because the %%page_unix_name%% also returns the category of the current page, <strong>fr:</strong>.</p> <h2><span>Conclusion - the missing puzzle piece <span style="text-decoration: line-through;">is</span> was &#8230;</span></h2> <p>the <a href="http://www.wikidot.com/doc:templates/comments/show#post-308734">right part of the pagename</a>.</p> <blockquote> <p>That's incredible. Never seen in the world of software companies:<br /> A request during the WE, fulfilled on Monday !</p> <p>Thanks</p> </blockquote> <h2><span>Author</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/gerdami" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=3370&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="gerdami" style="background-image:url(http://www.wikidot.com/userkarma.php?u=3370)" /></a><a href="http://www.wikidot.com/user:info/gerdami" >gerdami</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:gerdami">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/gerdami" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=3370&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="gerdami" style="background-image:url(http://www.wikidot.com/userkarma.php?u=3370)" /></a><a href="http://www.wikidot.com/user:info/gerdami" >gerdami</a></span></p> <div class="footnotes-footer"> <div class="title">Footnotes</div> <div class="footnote-footer" id="footnote-350065-1"><a href="javascript:;" >1</a>. fr:_template and de:_template have the same content, except that the &quot;page also available&quot; has been translated</div> </div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:include-forum-thread</guid>
				<title>Include a Forum Thread</title>
				<link>http://community.wikidot.com/howto:include-forum-thread</link>
				<description>

&lt;h1&gt;&lt;span&gt;Include Forum Thread on Page&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 28 Jul 2008 14:21:41 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h1><span>Include Forum Thread on Page</span></h1> <p>If you'd like to show (include) a thread from your forum on another page of your wiki, use [[module ForumThread t=&quot;<em>nnnnn</em>&quot;]] where <em>nnnnn</em> is the thread id of the thread you want to be included on your page.</p> <p>A drawback of the proposed solution is a <a href="#drawback">changed page title</a>.</p> <h2><span>Example</span></h2> <table style="border-collapse:collapse;border-top:2px solid;border-bottom:2px solid"> <tr> <td style="padding:3px 1em 3px 0"><em><strong>What you type &#8230;</strong></em></td> <td><em><strong>What you get&#8230;</strong></em></td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code>[[module ForumThread t=&quot;76393&quot;]]</code></pre></div> </td> <td><span style="font-size:50%;"></span></td> </tr> </table> <h2><span><a name="drawback"></a>Drawbacks / Problems</span></h2> <p>Module ForumThread automatically replaces the page's title with the thread title.</p> <p>In the above example the typed page title &#8220;Include a Forum Thread&#8221; is replaced by the thread name<br /> &#8220;Duplicate page tags&#8221;.</p> <h2><span>Links</span></h2> <p>Forum thread <a href="http://community.wikidot.com/forum/t-76961">include thread in page</a> discussing this problem</p> <h2><span>Backlinks</span></h2> <h2><span>Author</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:erichsteinboeck">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:sortable-list-of-pages</guid>
				<title>Create Sortable List of Pages</title>
				<link>http://community.wikidot.com/howto:sortable-list-of-pages</link>
				<description>

&lt;h1&gt;&lt;span&gt;How to Create a Sortable List of Pages&lt;/span&gt;&lt;/h1&gt;
&lt;table style=&quot;margin:0; padding:0&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;margin:0; padding:0&quot;&gt;
&lt;div id=&quot;toc&quot;&gt;
&lt;div id=&quot;toc-action-bar&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;Fold&lt;/a&gt;&lt;a style=&quot;display: none&quot; href=&quot;javascript:;&quot;  &gt;Unfold&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;title&quot;&gt;Table of Contents&lt;/div&gt;
&lt;div id=&quot;toc-list&quot;&gt;
&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc0&quot;&gt;How to Create a Sortable List of Pages&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc1&quot;&gt;How to Set Up Sortable Lists of Pages Step-by-Step&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc2&quot;&gt;Step One: Set Up a &amp;#8216;Base Page&amp;#8217;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc3&quot;&gt;Step Two: Set Up a &amp;#8216;prepend page&amp;#8217;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc4&quot;&gt;Step Three: Set Up a &amp;#8216;Front-End&amp;#8217; Page&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc5&quot;&gt;Step Four: Create Individual Sortable Lists of Pages&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc6&quot;&gt;Examples&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc7&quot;&gt;Category &amp;#8220;_default&amp;#8221;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc8&quot;&gt;Community How-To&#039;s&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc9&quot;&gt;All Categories&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc10&quot;&gt;How it Works&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc11&quot;&gt;Links&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc12&quot;&gt;Backlinks&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#toc13&quot;&gt;Authors&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;Listing pages that you have are among the features that you want to have in your site for facilitating navigation among pages. It is true that you can create indexes to help the user find a particular page, or he can &lt;em&gt;Search&lt;/em&gt; for a page or use the &lt;em&gt;Tags cloud&lt;/em&gt;. However, having a list that gets automatically populated whenever a page is added or edited, may prove handy and worthy.&lt;/p&gt;
&lt;p&gt;Wikidot offers the function &lt;em&gt;List all pages&lt;/em&gt;, which lists all pages alphabetically and, thus, may do the trick. However, as its name says, it lists &lt;em&gt;all&lt;/em&gt; the pages. This may prove not useful for two reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On the one hand, some pages are not for users (such as administrative pages pertaining to the categories &lt;em&gt;system:&lt;/em&gt; or &lt;em&gt;admin:&lt;/em&gt;). Displaying them together with the remaining pages simply clutters the list.&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;On the other hand, the resulting list is simply an alphabetical one, neither organized in categories nor with possibilities to be searched for edit date or creation date.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is a way of creating sortable lists that solves above limitations. The procedure involves a four-step setup.&lt;/p&gt;
&lt;h1&gt;&lt;span&gt;How to Set Up &lt;em&gt;Sortable Lists of Pages&lt;/em&gt; Step-by-Step&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;Steps 1 &amp;amp; 2 are a one-time setup procedure to create the support for all individual &lt;em&gt;Sortable lists of pages&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Step One: Set Up a &amp;#8216;Base Page&amp;#8217;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;In this step you create a new page in an &lt;em&gt;inc:&lt;/em&gt; category to be called &lt;strong&gt;list-pages-template&lt;/strong&gt;. Do the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Create a new page&lt;/em&gt; called &lt;strong&gt;inc:list-pages-template&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;copy and paste (or type) the following module syntax onto the page (copy and paste from the html version)&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;{$heading}[[# A_{$anchor}]]
[[size {$size}]]
[[module ListPages category=&amp;quot;{$category}&amp;quot; perPage=&amp;quot;{$perPage}&amp;quot; limit=&amp;quot;{$limit}&amp;quot; _
separate=&amp;quot;false&amp;quot; {$attributes} _
prependLine=&amp;quot;[[include inc:list-pages-prepend page={$page} | anchor={$anchor} | styleT={$styleT} | styleE={$styleE} | styleC={$styleC}]]&amp;quot; _
appendLine=&amp;quot;[[/table]]&amp;quot; _
]]
[[row]][[cell style=&amp;quot;{$styleT}&amp;quot;]][{$urlEdit}] {$urlView}[[/cell]][[cell style=&amp;quot;{$styleE}&amp;quot;]]%%date_edited|%e %b %Y, %R%%[[/cell]][[cell style=&amp;quot;{$styleC}&amp;quot;]]%%date|%e %b %Y, %R%%[[/cell]][[/row]]
[[/module]]
[[/size]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;&lt;span&gt;Step Two: Set Up a &amp;#8216;prepend page&amp;#8217;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Create a new page&lt;/em&gt; called &lt;strong&gt;inc:list-pages-prepend&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Copy and paste (or type) the following code onto the page:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt; [[table]][[row]][[cell style=&amp;quot;{$styleT}&amp;quot;]]//Page Name//[[/cell]][[cell style=&amp;quot;{$styleE}&amp;quot;]]//Last Edited//[[/cell]][[cell style=&amp;quot;{$styleC}&amp;quot;]]//Date Created//[[/cell]][[/row]][[row]][[cell style=&amp;quot;{$styleT}&amp;quot;]][[size 80%]]Sort [/{$page}/order/titleAsc#A_{$anchor} ascending]/[/{$page}/order/titleDesc#A_{$anchor} descending][[/size]][[/cell]][[cell style=&amp;quot;{$styleE}&amp;quot;]][[size 80%]]Sort [/{$page}/order/dateEditedDesc#A_{$anchor} newest first]/[/{$page}/order/dateEditedAsc#A_{$anchor} oldest first][[/size]][[/cell]][[cell style=&amp;quot;{$styleC}&amp;quot;]][[size 80%]]Sort [/{$page}/order/dateCreatedDesc#A_{$anchor} newest first]/[/{$page}/order/dateCreatedAsc#A_{$anchor} oldest first][[/size]][[/cell]][[/row]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;&lt;span&gt;Step Three: Set Up a &amp;#8216;Front-End&amp;#8217; Page&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This front-end page specifies default values for all &lt;em&gt;include&lt;/em&gt; parameters of your lists. This will make it much easier to create individual and customized //Sortable list of pages&amp;quot;, as you only have to specify the relevant parameters on each [[include &amp;#8230;]] statement in these individual and customized lists (see step 4). Do as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Create a new page&lt;/em&gt; called &lt;strong&gt;inc:list-pages&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Copy and paste (or type) the following code onto the page:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt; [[include inc:list-pages-template
heading={$heading} | heading=++ Category &amp;quot;{$category}&amp;quot; |
anchor={$anchor} | anchor={$category} |
category={$category} | category=_default |
page={$page} | page=system:list-pages |
perPage={$perPage} | perPage={$limit} |
limit={$limit} | limit=10000 |
attributes={$attributes} | attributes=order=&amp;quot;@URL&amp;quot; |
styleT={$styleT} | styleT=padding-right:1em |
styleE={$styleE} | styleE=text-align:right; padding-right:1em; width:12em |
styleC={$styleC} | styleC=text-align:right; width:13em |
urlEdit=/%%fullname%%/edit/true edit |
urlView=: %%title_linked%% |
size={$size} | size=100% |
]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Once you have done this, the page will display a list of the pages in the &amp;quot;_default&amp;quot; category. However, don&#039;t think of this as your final list. This page is only part of the basic setup, and, thus, should remain &amp;quot;hidden.&amp;quot; For creating &lt;em&gt;Sortable lists of pages&lt;/em&gt; that you can really use, you need to continue into step four.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;span&gt;Step Four: Create Individual &lt;em&gt;Sortable Lists of Pages&lt;/em&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;You may need just one &lt;em&gt;Sortable list of pages&lt;/em&gt;, or you might want to create more than one. You might prefer to create individual lists in different pages, or just several lists in the one page. Finally, you might want to customize your lists (e. g. one that lists all pages for some selected category, or one that lists all pages for all categories). This third step allows you to do all of that by way of creating individual &lt;em&gt;Sortable lists of pages&lt;/em&gt; customized to your needs.&lt;/p&gt;
&lt;p&gt;Let&#039;s talk about customization first. You can customize each &lt;em&gt;Sortable list of pages&lt;/em&gt; according to the parameters shown in the following table (see some examples in the next section):&lt;/p&gt;
&lt;table class=&quot;wiki-content-table&quot;&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Default&lt;sup class=&quot;footnoteref&quot;&gt;&lt;a id=&quot;footnoteref-970412-1&quot; href=&quot;javascript:;&quot; class=&quot;footnoteref&quot;  &gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;page&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;system:list-pages&lt;/td&gt;
&lt;td&gt;The name of the &amp;quot;Sortable List of Pages&amp;quot; page you are creating; i. e. the page where you use &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;inc:list-pages&amp;#32;...]]&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;category&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&amp;quot;_default&amp;quot;&lt;/td&gt;
&lt;td&gt;A category name or category names as defined in the module &lt;a href=&quot;http://www.wikidot.com/doc:listpages-module&quot;&gt;ListPages&lt;/a&gt; documentation. Pages will be listed from this/these category/ies. Note that you cannot use the alias &lt;tt&gt;categories&lt;/tt&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;heading&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;++ Category &lt;em&gt;&lt;tt&gt;category&lt;/tt&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Any Wikidot text to be used as a header&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;anchor&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;tt&gt;category&lt;/tt&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;If the (list of) category/ies include any characters except &amp;quot;A/a&amp;quot; through &amp;quot;Z/z&amp;quot;, &amp;quot;0&amp;quot; through &amp;quot;9&amp;quot;, &amp;quot;-&amp;quot;, &amp;quot;_&amp;quot;, &amp;quot;.&amp;quot;, or &amp;quot;%&amp;quot;, a unique text string must be specified to be used as an &amp;quot;anchor&amp;quot; for generated links. An anchor prevents the page from scrolling to the top when a user clicks any of the sort links. For example, if &amp;quot;category=*&amp;quot; use &amp;quot;anchor=all&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;limit&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;10000&lt;/td&gt;
&lt;td&gt;the maximum number of pages (i. e. lines) that will be listed as defined in the module &lt;a href=&quot;http://www.wikidot.com/doc:listpages-module&quot;&gt;ListPages&lt;/a&gt; documentation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;perPage&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;tt&gt;limit&lt;/tt&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;the number of maximum of pages (i. e. lines) that will be listed before automatic ListPages pagination starts. As defined in the module &lt;a href=&quot;http://www.wikidot.com/doc:listpages-module&quot;&gt;ListPages&lt;/a&gt; documentation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;attributes&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;rssEmbed=&amp;quot;false&amp;quot; rssShow=&amp;quot;false&amp;quot;&lt;/td&gt;
&lt;td&gt;Any required additional ListPages attributes as defined in the module &lt;a href=&quot;http://www.wikidot.com/doc:listpages-module&quot;&gt;ListPages&lt;/a&gt; documentation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;styleT&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;padding-right:1em&lt;/td&gt;
&lt;td&gt;Any CSS style attributes for the first column (Page Name). Note that due to a &lt;a href=&quot;http://www.wikidot.com/doc:listpages-module/comments/show#post-205192&quot;&gt;Wikidot parser problem&lt;/a&gt; this style attribute currently cannot be applied to the &lt;em&gt;header&lt;/em&gt; row of the first column.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;styleE&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;text-align:right; padding-right:1em; width:12em&lt;/td&gt;
&lt;td&gt;Any CSS style attributes for the second column (Last Edited Date). Note that due to a &lt;a href=&quot;http://www.wikidot.com/doc:listpages-module/comments/show#post-205192&quot;&gt;Wikidot parser problem&lt;/a&gt; this style attribute currently cannot be applied to the &lt;em&gt;header&lt;/em&gt; row of the second column.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;tt&gt;styleC&lt;/tt&gt;&lt;/td&gt;
&lt;td&gt;text-align:right; width:12em&lt;/td&gt;
&lt;td&gt;Any CSS style attributes for the third column (Creation Date). Note that due to a &lt;a href=&quot;http://www.wikidot.com/doc:listpages-module/comments/show#post-205192&quot;&gt;Wikidot parser problem&lt;/a&gt; this style attribute currently cannot be applied to the &lt;em&gt;header&lt;/em&gt; row of the third column.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;To set up an individual and customized &lt;em&gt;Sortable list of pages&lt;/em&gt; you need to do the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a new page that will hold your customized list (or lists, if you code several of them in the same page).&lt;/li&gt;
&lt;li&gt;Include the &amp;quot;front-end&amp;quot; page that you created in step 2 using an &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;inc:list-pages&amp;#32;...]]&lt;/span&gt; statement (see &lt;a href=&quot;#examples&quot;&gt;Examples&lt;/a&gt; below).&lt;/li&gt;
&lt;li&gt;Write down the parameters that you require for customizing your list (write them as &lt;strong&gt;parameter=value |&lt;/strong&gt;, as shown in the examples in the next section).&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;The most important parameter &amp;#8212; &lt;tt&gt;page&lt;/tt&gt; &amp;#8212; is the name of your actual individual page (i. e. this new page that you have just created), so that the different sorting options work within the same page.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;All other parameters are optional, and not writing them simply means that the &amp;quot;default&amp;quot; value of the parameter will be displayed instead. Customizing your list means, basically, writing down those parameters that you require (and their values).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can create &lt;em&gt;Sortable lists of pages&lt;/em&gt; in different pages, but you can also display several of them in a single page (as in the example below) by simply repeating the procedure of step three (i. e. syntax and customization) as required.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: the pages that you create in step three do not necessarily need to be within the &lt;em&gt;inc:&lt;/em&gt; category. It can be in any category, e. g. the &lt;em&gt;_default:&lt;/em&gt; category. As far as in any of those pages you include the &lt;em&gt;inc:list-page&lt;/em&gt; page (your &amp;quot;front-end&amp;quot; page, see step 2), you should be alright.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;span&gt;&lt;a name=&quot;examples&quot;&gt;&lt;/a&gt;Examples&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Here are some examples of customized &lt;em&gt;Sortable list of pages&lt;/em&gt;. To the left of the table is the syntax that was written. To the right, the resulting output. You can now click on each sorting option (ascending / descending, etc) and see it working!&lt;/p&gt;
&lt;table style=&quot;width:100%; border-collapse:collapse; border-top:2px solid; border-bottom:2px solid&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;width:33%; padding:3px 1em 3px 0&quot;&gt;&lt;em&gt;&lt;strong&gt;What you type &amp;#8230;&lt;/strong&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;strong&gt;What you get &amp;#8230;&lt;/strong&gt;&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;border-top:1px solid&quot;&gt;
&lt;td style=&quot;padding:3px 1em 3px 0&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt; [[include inc:list-pages 
page=howto:sortable-list-of-pages]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;div style=&quot;font-size:smaller&quot;&gt;
&lt;h2&gt;&lt;span&gt;Category &amp;#8220;_default&amp;#8221;&lt;a name=&quot;A__default&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-size:89%;&quot;&gt;&lt;/span&gt;
&lt;p&gt;.&lt;br /&gt;
.&lt;br /&gt;
.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;border-top:1px solid&quot;&gt;
&lt;td style=&quot;padding:3px 1em 3px 0&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt; [[include inc:list-pages 
page=howto:sortable-list-of-pages | 
category=howto |
heading=++ Community How-To&#039;s]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;div style=&quot;font-size:smaller&quot;&gt;
&lt;h2&gt;&lt;span&gt;Community How-To&#039;s&lt;a name=&quot;A_howto&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-size:89%;&quot;&gt;&lt;/span&gt;
&lt;p&gt;.&lt;br /&gt;
.&lt;br /&gt;
.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;border-top:1px solid&quot;&gt;
&lt;td style=&quot;padding:3px 1em 3px 0&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt; [[include inc:list-pages
page=howto:sortable-list-of-pages | 
category=* |
anchor=all |
heading=++ All Categories]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;div style=&quot;font-size:smaller&quot;&gt;
&lt;h2&gt;&lt;span&gt;All Categories&lt;a name=&quot;A_all&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-size:89%;&quot;&gt;&lt;/span&gt;
&lt;p&gt;.&lt;br /&gt;
.&lt;br /&gt;
.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h2&gt;&lt;span&gt;How it Works&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This How-To makes use of two ideas presented in&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://community.wikidot.com/howto:module-attributes-via-url&quot;&gt;Module Attributes Via URL&lt;/a&gt;, to dynamically specify order (sort) sequence via the URL link, and&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://community.wikidot.com/howto:include-with-defaults&quot;&gt;Include Variables With Default Values&lt;/a&gt;, to pre-define values for include variables.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span&gt;Links&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;A real-life application of this idea can be found in the Community Wikidot &lt;a href=&quot;http://community.wikidot.com/system:list-pages&quot;&gt;List all Pages&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Backlinks&lt;/span&gt;&lt;/h2&gt;

&lt;h2&gt;&lt;span&gt;Authors&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;. &lt;span style=&quot;font-size:smaller;&quot;&gt;Please visit his/her &lt;a href=&quot;http://community.wikidot.com/user:erichsteinboeck&quot;&gt;userPage&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/jdperezgonzalez&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=148050&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;JDPerezgonzalez&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=148050)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/jdperezgonzalez&quot;  &gt;JDPerezgonzalez&lt;/a&gt;&lt;/span&gt;. &lt;span style=&quot;font-size:smaller;&quot;&gt;Please visit his/her &lt;a class=&quot;newpage&quot; href=&quot;http://community.wikidot.com/user:jdperezgonzalez&quot;&gt;userPage&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;footnotes-footer&quot;&gt;
&lt;div class=&quot;title&quot;&gt;Footnotes&lt;/div&gt;
&lt;div class=&quot;footnote-footer&quot; id=&quot;footnote-970412-1&quot;&gt;&lt;a href=&quot;javascript:;&quot;  &gt;1&lt;/a&gt;. An italic &lt;em&gt;&lt;tt&gt;parameter&lt;/tt&gt;&lt;/em&gt; means &amp;quot;value of this parameter&amp;quot;&lt;/div&gt;
&lt;/div&gt;
</description>
				<pubDate>Sat, 28 Jun 2008 17:35:20 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h1><span>How to Create a Sortable List of Pages</span></h1> <table style="margin:0; padding:0"> <tr> <td style="margin:0; padding:0"> <div id="toc"> <div id="toc-action-bar"><a href="javascript:;" >Fold</a><a style="display: none" href="javascript:;" >Unfold</a></div> <div class="title">Table of Contents</div> <div id="toc-list"> <div style="margin-left: 1em;"><a href="#toc0">How to Create a Sortable List of Pages</a></div> <div style="margin-left: 1em;"><a href="#toc1">How to Set Up Sortable Lists of Pages Step-by-Step</a></div> <div style="margin-left: 2em;"><a href="#toc2">Step One: Set Up a &#8216;Base Page&#8217;</a></div> <div style="margin-left: 2em;"><a href="#toc3">Step Two: Set Up a &#8216;prepend page&#8217;</a></div> <div style="margin-left: 2em;"><a href="#toc4">Step Three: Set Up a &#8216;Front-End&#8217; Page</a></div> <div style="margin-left: 2em;"><a href="#toc5">Step Four: Create Individual Sortable Lists of Pages</a></div> <div style="margin-left: 2em;"><a href="#toc6">Examples</a></div> <div style="margin-left: 2em;"><a href="#toc7">Category &#8220;_default&#8221;</a></div> <div style="margin-left: 2em;"><a href="#toc8">Community How-To's</a></div> <div style="margin-left: 2em;"><a href="#toc9">All Categories</a></div> <div style="margin-left: 2em;"><a href="#toc10">How it Works</a></div> <div style="margin-left: 2em;"><a href="#toc11">Links</a></div> <div style="margin-left: 2em;"><a href="#toc12">Backlinks</a></div> <div style="margin-left: 2em;"><a href="#toc13">Authors</a></div> </div> </div> </td> </tr> </table> <p>Listing pages that you have are among the features that you want to have in your site for facilitating navigation among pages. It is true that you can create indexes to help the user find a particular page, or he can <em>Search</em> for a page or use the <em>Tags cloud</em>. However, having a list that gets automatically populated whenever a page is added or edited, may prove handy and worthy.</p> <p>Wikidot offers the function <em>List all pages</em>, which lists all pages alphabetically and, thus, may do the trick. However, as its name says, it lists <em>all</em> the pages. This may prove not useful for two reasons:</p> <ul> <li>On the one hand, some pages are not for users (such as administrative pages pertaining to the categories <em>system:</em> or <em>admin:</em>). Displaying them together with the remaining pages simply clutters the list.<br /> <br /></li> <li>On the other hand, the resulting list is simply an alphabetical one, neither organized in categories nor with possibilities to be searched for edit date or creation date.</li> </ul> <p>There is a way of creating sortable lists that solves above limitations. The procedure involves a four-step setup.</p> <h1><span>How to Set Up <em>Sortable Lists of Pages</em> Step-by-Step</span></h1> <p>Steps 1 &amp; 2 are a one-time setup procedure to create the support for all individual <em>Sortable lists of pages</em>.</p> <h2><span>Step One: Set Up a &#8216;Base Page&#8217;</span></h2> <p>In this step you create a new page in an <em>inc:</em> category to be called <strong>list-pages-template</strong>. Do the following:</p> <ul> <li><em>Create a new page</em> called <strong>inc:list-pages-template</strong></li> </ul> <ul> <li>copy and paste (or type) the following module syntax onto the page (copy and paste from the html version)</li> </ul> <div class="code"> <pre><code>{$heading}[[# A_{$anchor}]] [[size {$size}]] [[module ListPages category=&quot;{$category}&quot; perPage=&quot;{$perPage}&quot; limit=&quot;{$limit}&quot; _ separate=&quot;false&quot; {$attributes} _ prependLine=&quot;[[include inc:list-pages-prepend page={$page} | anchor={$anchor} | styleT={$styleT} | styleE={$styleE} | styleC={$styleC}]]&quot; _ appendLine=&quot;[[/table]]&quot; _ ]] [[row]][[cell style=&quot;{$styleT}&quot;]][{$urlEdit}] {$urlView}[[/cell]][[cell style=&quot;{$styleE}&quot;]]%%date_edited|%e %b %Y, %R%%[[/cell]][[cell style=&quot;{$styleC}&quot;]]%%date|%e %b %Y, %R%%[[/cell]][[/row]] [[/module]] [[/size]]</code></pre></div> <h2><span>Step Two: Set Up a &#8216;prepend page&#8217;</span></h2> <ul> <li><em>Create a new page</em> called <strong>inc:list-pages-prepend</strong></li> </ul> <ul> <li>Copy and paste (or type) the following code onto the page:</li> </ul> <div class="code"> <pre><code> [[table]][[row]][[cell style=&quot;{$styleT}&quot;]]//Page Name//[[/cell]][[cell style=&quot;{$styleE}&quot;]]//Last Edited//[[/cell]][[cell style=&quot;{$styleC}&quot;]]//Date Created//[[/cell]][[/row]][[row]][[cell style=&quot;{$styleT}&quot;]][[size 80%]]Sort [/{$page}/order/titleAsc#A_{$anchor} ascending]/[/{$page}/order/titleDesc#A_{$anchor} descending][[/size]][[/cell]][[cell style=&quot;{$styleE}&quot;]][[size 80%]]Sort [/{$page}/order/dateEditedDesc#A_{$anchor} newest first]/[/{$page}/order/dateEditedAsc#A_{$anchor} oldest first][[/size]][[/cell]][[cell style=&quot;{$styleC}&quot;]][[size 80%]]Sort [/{$page}/order/dateCreatedDesc#A_{$anchor} newest first]/[/{$page}/order/dateCreatedAsc#A_{$anchor} oldest first][[/size]][[/cell]][[/row]]</code></pre></div> <h2><span>Step Three: Set Up a &#8216;Front-End&#8217; Page</span></h2> <p>This front-end page specifies default values for all <em>include</em> parameters of your lists. This will make it much easier to create individual and customized //Sortable list of pages&quot;, as you only have to specify the relevant parameters on each [[include &#8230;]] statement in these individual and customized lists (see step 4). Do as follows:</p> <ul> <li><em>Create a new page</em> called <strong>inc:list-pages</strong></li> </ul> <ul> <li>Copy and paste (or type) the following code onto the page:</li> </ul> <div class="code"> <pre><code> [[include inc:list-pages-template heading={$heading} | heading=++ Category &quot;{$category}&quot; | anchor={$anchor} | anchor={$category} | category={$category} | category=_default | page={$page} | page=system:list-pages | perPage={$perPage} | perPage={$limit} | limit={$limit} | limit=10000 | attributes={$attributes} | attributes=order=&quot;@URL&quot; | styleT={$styleT} | styleT=padding-right:1em | styleE={$styleE} | styleE=text-align:right; padding-right:1em; width:12em | styleC={$styleC} | styleC=text-align:right; width:13em | urlEdit=/%%fullname%%/edit/true edit | urlView=: %%title_linked%% | size={$size} | size=100% | ]]</code></pre></div> <blockquote> <p>Once you have done this, the page will display a list of the pages in the &quot;_default&quot; category. However, don't think of this as your final list. This page is only part of the basic setup, and, thus, should remain &quot;hidden.&quot; For creating <em>Sortable lists of pages</em> that you can really use, you need to continue into step four.</p> </blockquote> <h2><span>Step Four: Create Individual <em>Sortable Lists of Pages</em></span></h2> <p>You may need just one <em>Sortable list of pages</em>, or you might want to create more than one. You might prefer to create individual lists in different pages, or just several lists in the one page. Finally, you might want to customize your lists (e. g. one that lists all pages for some selected category, or one that lists all pages for all categories). This third step allows you to do all of that by way of creating individual <em>Sortable lists of pages</em> customized to your needs.</p> <p>Let's talk about customization first. You can customize each <em>Sortable list of pages</em> according to the parameters shown in the following table (see some examples in the next section):</p> <table class="wiki-content-table"> <tr> <th>Parameter</th> <th>Default<sup class="footnoteref"><a id="footnoteref-718315-1" href="javascript:;" class="footnoteref" >1</a></sup></th> <th>Description</th> </tr> <tr> <td><tt>page</tt></td> <td>system:list-pages</td> <td>The name of the &quot;Sortable List of Pages&quot; page you are creating; i. e. the page where you use <span style="white-space: pre-wrap;">[[include&#32;inc:list-pages&#32;...]]</span></td> </tr> <tr> <td><tt>category</tt></td> <td>&quot;_default&quot;</td> <td>A category name or category names as defined in the module <a href="http://www.wikidot.com/doc:listpages-module">ListPages</a> documentation. Pages will be listed from this/these category/ies. Note that you cannot use the alias <tt>categories</tt></td> </tr> <tr> <td><tt>heading</tt></td> <td>++ Category <em><tt>category</tt></em></td> <td>Any Wikidot text to be used as a header</td> </tr> <tr> <td><tt>anchor</tt></td> <td><em><tt>category</tt></em></td> <td>If the (list of) category/ies include any characters except &quot;A/a&quot; through &quot;Z/z&quot;, &quot;0&quot; through &quot;9&quot;, &quot;-&quot;, &quot;_&quot;, &quot;.&quot;, or &quot;%&quot;, a unique text string must be specified to be used as an &quot;anchor&quot; for generated links. An anchor prevents the page from scrolling to the top when a user clicks any of the sort links. For example, if &quot;category=*&quot; use &quot;anchor=all&quot;</td> </tr> <tr> <td><tt>limit</tt></td> <td>10000</td> <td>the maximum number of pages (i. e. lines) that will be listed as defined in the module <a href="http://www.wikidot.com/doc:listpages-module">ListPages</a> documentation</td> </tr> <tr> <td><tt>perPage</tt></td> <td><em><tt>limit</tt></em></td> <td>the number of maximum of pages (i. e. lines) that will be listed before automatic ListPages pagination starts. As defined in the module <a href="http://www.wikidot.com/doc:listpages-module">ListPages</a> documentation</td> </tr> <tr> <td><tt>attributes</tt></td> <td>rssEmbed=&quot;false&quot; rssShow=&quot;false&quot;</td> <td>Any required additional ListPages attributes as defined in the module <a href="http://www.wikidot.com/doc:listpages-module">ListPages</a> documentation</td> </tr> <tr> <td><tt>styleT</tt></td> <td>padding-right:1em</td> <td>Any CSS style attributes for the first column (Page Name). Note that due to a <a href="http://www.wikidot.com/doc:listpages-module/comments/show#post-205192">Wikidot parser problem</a> this style attribute currently cannot be applied to the <em>header</em> row of the first column.</td> </tr> <tr> <td><tt>styleE</tt></td> <td>text-align:right; padding-right:1em; width:12em</td> <td>Any CSS style attributes for the second column (Last Edited Date). Note that due to a <a href="http://www.wikidot.com/doc:listpages-module/comments/show#post-205192">Wikidot parser problem</a> this style attribute currently cannot be applied to the <em>header</em> row of the second column.</td> </tr> <tr> <td><tt>styleC</tt></td> <td>text-align:right; width:12em</td> <td>Any CSS style attributes for the third column (Creation Date). Note that due to a <a href="http://www.wikidot.com/doc:listpages-module/comments/show#post-205192">Wikidot parser problem</a> this style attribute currently cannot be applied to the <em>header</em> row of the third column.</td> </tr> </table> <p>To set up an individual and customized <em>Sortable list of pages</em> you need to do the following:</p> <ul> <li>Create a new page that will hold your customized list (or lists, if you code several of them in the same page).</li> <li>Include the &quot;front-end&quot; page that you created in step 2 using an <span style="white-space: pre-wrap;">[[include&#32;inc:list-pages&#32;...]]</span> statement (see <a href="#examples">Examples</a> below).</li> <li>Write down the parameters that you require for customizing your list (write them as <strong>parameter=value |</strong>, as shown in the examples in the next section).</li> </ul> <blockquote> <p>The most important parameter &#8212; <tt>page</tt> &#8212; is the name of your actual individual page (i. e. this new page that you have just created), so that the different sorting options work within the same page.</p> </blockquote> <blockquote> <p>All other parameters are optional, and not writing them simply means that the &quot;default&quot; value of the parameter will be displayed instead. Customizing your list means, basically, writing down those parameters that you require (and their values).</p> </blockquote> <p>You can create <em>Sortable lists of pages</em> in different pages, but you can also display several of them in a single page (as in the example below) by simply repeating the procedure of step three (i. e. syntax and customization) as required.</p> <blockquote> <p>Note: the pages that you create in step three do not necessarily need to be within the <em>inc:</em> category. It can be in any category, e. g. the <em>_default:</em> category. As far as in any of those pages you include the <em>inc:list-page</em> page (your &quot;front-end&quot; page, see step 2), you should be alright.</p> </blockquote> <h2><span><a name="examples"></a>Examples</span></h2> <p>Here are some examples of customized <em>Sortable list of pages</em>. To the left of the table is the syntax that was written. To the right, the resulting output. You can now click on each sorting option (ascending / descending, etc) and see it working!</p> <table style="width:100%; border-collapse:collapse; border-top:2px solid; border-bottom:2px solid"> <tr> <td style="width:33%; padding:3px 1em 3px 0"><em><strong>What you type &#8230;</strong></em></td> <td><em><strong>What you get &#8230;</strong></em></td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code> [[include inc:list-pages page=howto:sortable-list-of-pages]]</code></pre></div> </td> <td> <div style="font-size:smaller"> <h2><span>Category &#8220;_default&#8221;<a name="A__default"></a></span></h2> <span style="font-size:89%;"></span> <p>.<br /> .<br /> .</p> </div> </td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code> [[include inc:list-pages page=howto:sortable-list-of-pages | category=howto | heading=++ Community How-To's]]</code></pre></div> </td> <td> <div style="font-size:smaller"> <h2><span>Community How-To's<a name="A_howto"></a></span></h2> <span style="font-size:89%;"></span> <p>.<br /> .<br /> .</p> </div> </td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code> [[include inc:list-pages page=howto:sortable-list-of-pages | category=* | anchor=all | heading=++ All Categories]]</code></pre></div> </td> <td> <div style="font-size:smaller"> <h2><span>All Categories<a name="A_all"></a></span></h2> <span style="font-size:89%;"></span> <p>.<br /> .<br /> .</p> </div> </td> </tr> </table> <h2><span>How it Works</span></h2> <p>This How-To makes use of two ideas presented in</p> <ul> <li><a href="http://community.wikidot.com/howto:module-attributes-via-url">Module Attributes Via URL</a>, to dynamically specify order (sort) sequence via the URL link, and</li> <li><a href="http://community.wikidot.com/howto:include-with-defaults">Include Variables With Default Values</a>, to pre-define values for include variables.</li> </ul> <h2><span>Links</span></h2> <p>A real-life application of this idea can be found in the Community Wikidot <a href="http://community.wikidot.com/system:list-pages">List all Pages</a>.</p> <h2><span>Backlinks</span></h2> <h2><span>Authors</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:erichsteinboeck">userPage</a>.</span></p> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/jdperezgonzalez" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=148050&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="JDPerezgonzalez" style="background-image:url(http://www.wikidot.com/userkarma.php?u=148050)" /></a><a href="http://www.wikidot.com/user:info/jdperezgonzalez" >JDPerezgonzalez</a></span>. <span style="font-size:smaller;">Please visit his/her <a class="newpage" href="http://community.wikidot.com/user:jdperezgonzalez">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span></p> <div class="footnotes-footer"> <div class="title">Footnotes</div> <div class="footnote-footer" id="footnote-718315-1"><a href="javascript:;" >1</a>. An italic <em><tt>parameter</tt></em> means &quot;value of this parameter&quot;</div> </div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/bugs:14</guid>
				<title>Code block not recognizing the include</title>
				<link>http://community.wikidot.com/bugs:14</link>
				<description>

&lt;h1&gt;&lt;span&gt;Description&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;Using code block with include in a page : eg&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[code]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;template:spoons]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[/code]]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;should produce&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;template:spoons]]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In a forum post, this works fine,&lt;br /&gt;
However in a Normal page&lt;br /&gt;
it produces&lt;br /&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt;[[div class=&amp;quot;error-block&amp;quot;]]
Included page &amp;quot;template:spoons&amp;quot; does not exist ([/template:spoons/edit/true create it now])
[[/div]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;&lt;span&gt;Links&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;&lt;a href=&quot;http://community.wikidot.com/forum/t-65103/code-block-not-recognizing-the-include-tag#post-184748&quot;&gt;http://community.wikidot.com/forum/t-65103/code-block-not-recognizing-the-include-tag#post-184748&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;&lt;span&gt;How to Reproduce&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;see above&lt;/p&gt;
&lt;h1&gt;&lt;span&gt;Browsers&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;All&lt;/p&gt;
&lt;h1&gt;&lt;span&gt;Workarounds&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;As a workaround to get the desired result, add a leading space in front of &lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[include&amp;#32;...]]&lt;/span&gt;, like this:&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[code]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size:1%;&quot;&gt;.&lt;/span&gt; [[include template:spoons]]&lt;br /&gt;
&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;[[/code]]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here&#039;s the result:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre&gt;&lt;code&gt; [[include template:spoons]]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;&lt;span&gt;Reported By&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;&lt;span class=&quot;printuser&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/alderman&quot;  &gt;Alderman&lt;/a&gt;&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/phil-chett&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=4297&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;Phil Chett&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=4297)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/phil-chett&quot;  &gt;Phil Chett&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Sat, 07 Jun 2008 11:14:17 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h1><span>Description</span></h1> <p>Using code block with include in a page : eg</p> <p><span style="white-space: pre-wrap;">[[code]]</span><br /> <span style="white-space: pre-wrap;">[[include&#32;template:spoons]]</span><br /> <span style="white-space: pre-wrap;">[[/code]]</span></p> <p>should produce</p> <p><span style="white-space: pre-wrap;">[[include&#32;template:spoons]]</span></p> <p>In a forum post, this works fine,<br /> However in a Normal page<br /> it produces<br /></p> <div class="code"> <pre><code>[[div class=&quot;error-block&quot;]] Included page &quot;template:spoons&quot; does not exist ([/template:spoons/edit/true create it now]) [[/div]]</code></pre></div> <h1><span>Links</span></h1> <p><a href="http://community.wikidot.com/forum/t-65103/code-block-not-recognizing-the-include-tag#post-184748">http://community.wikidot.com/forum/t-65103/code-block-not-recognizing-the-include-tag#post-184748</a></p> <h1><span>How to Reproduce</span></h1> <p>see above</p> <h1><span>Browsers</span></h1> <p>All</p> <h1><span>Workarounds</span></h1> <p>As a workaround to get the desired result, add a leading space in front of <span style="white-space: pre-wrap;">[[include&#32;...]]</span>, like this:<br /> <span style="white-space: pre-wrap;">[[code]]</span><br /> <span style="font-size:1%;">.</span> [[include template:spoons]]<br /> <span style="white-space: pre-wrap;">[[/code]]</span></p> <p>Here's the result:</p> <div class="code"> <pre><code> [[include template:spoons]]</code></pre></div> <h1><span>Reported By</span></h1> <p><span class="printuser"><a href="http://www.wikidot.com/user:info/alderman" >Alderman</a></span>.</p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/phil-chett" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=4297&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="Phil Chett" style="background-image:url(http://www.wikidot.com/userkarma.php?u=4297)" /></a><a href="http://www.wikidot.com/user:info/phil-chett" >Phil Chett</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/howto:include-with-defaults</guid>
				<title>Include With Defaults</title>
				<link>http://community.wikidot.com/howto:include-with-defaults</link>
				<description>

&lt;h1&gt;&lt;span&gt;Include Variables With Default Values&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Wed, 28 May 2008 17:42:20 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h1><span>Include Variables With Default Values</span></h1> <p>The <span style="white-space: pre-wrap;">[[</span><a href="http://www.wikidot.com/doc:wiki-syntax#toc37">include</a><span style="white-space: pre-wrap;">]]</span> tag can take parameters to substitute {$&#8230;} variables in the included template.</p> <p>If you want to make an include template more flexible, you can add more substitution variables to it. But there's a disadvantage: more substitution variables mean that you'll have to add more parameters to each and every of your <span style="white-space: pre-wrap;">[[include&#32;...]]</span> statements. And worse: if you later decide to change the include template by adding even more substitution variables, you'd have to change each of your <em>existing</em> <span style="white-space: pre-wrap;">[[include&#32;...]]</span> statements.</p> <p>What if you had a way to specify <em>default values</em> for substitution variables? <em>That</em> would solve the above problem.</p> <p>Here's a way how to give your substitution variables default values.</p> <h2><span>Step by Step</span></h2> <h4><span>Step 1</span></h4> <p>Create your <em>include template</em> as usual, adding substitution {$&#8230;} variables wherever you think they're appropriate.</p> <h4><span>Step 2</span></h4> <p>Create an <em>include front-end</em>. That's just another include template containing a single <span style="white-space: pre-wrap;">[[</span>include &#8230;<span style="white-space: pre-wrap;">]]</span> statement of the following form:</p> <blockquote> <p>[[include <em>include-template-name</em><br /> <em>parameter-n</em>={$<em>parameter-n</em>} | <em>parameter-n</em>=<em>default-value-n</em> |<br /> &#8230;<br /> <em>parameter-x</em>={$<em>parameter-x</em>} |<br /> &#8230; ]]</p> </blockquote> <p><span style="font-size:85%;"><em>Note:</em><br /> 1. <em>parameter-n</em> are the names of substitution variables that <em>need</em> default values. Those default values are specified as <em>default-value-n</em> in the second part<br /> 2. <em>parameter-x</em> are the names of substitution variables that do <em>not</em> need a default value<br /> 3. <em>All</em> possible substitution {$&#8230;} variables that are defined in the include template must be specified (either <em>with</em> or <em>without</em> a default value)</span></p> <h4><span>Step 3</span></h4> <p>In you page source, where you want to include your include template, use</p> <blockquote> <p>[[include <em>include-front-end-name</em> <em>parameter-x</em>=<em>value-x</em> | &#8230;]]</p> </blockquote> <p><span style="font-size:85%;"><em>Note:</em><br /> 1. You do not directly include your <em>include template</em>, but you include your <em>include frond-end</em> instead<br /> 2. You only have to specify parameters <em>without</em> a default value<br /> 3. Specifying parameters that have been given a default value in the include front-end is now optional</span></p> <h2><span>Examples</span></h2> <h4><span>Example Include Template</span></h4> <p>A sample <em>include template</em> called &#8220;template&#8221; might look like:</p> <div class="code"> <pre><code>{$heading} A description for ``{$topic}'' follows ...</code></pre></div> <h4><span>Example Include Front-End</span></h4> <p>The associated <em>front-end include</em> called &#8220;front-end&#8221; could be:</p> <div class="code"> <pre><code> [[include template heading={$heading} | heading=++++ {$topic} | topic={$topic} | topic=//Your Topic//]]</code></pre></div> <br /> This means, that both substitution variables, <em>heading</em>, and <em>topic</em>, have been given a default value: <ul> <li><em>topic</em> has a default value of &#8220;<span style="white-space: pre-wrap;">//Your&#32;Topic//</span>&#8221;</li> <li><em>heading</em> has a default value of &#8220;++++ {$topic}&#8221;</li> </ul> <p><span style="font-size:85%;"><em>Note:</em><br /> 1. Default values can have embedded Wikidot tags, in the case of <em>topic</em> it is italic formatting<br /> 2. You can give a substitution variable a default value, that is the value of another substitution variable. In the case of <em>heading</em> it is a level-four heading with the value of <em>topic</em><br /> 3. If you refer to the value of another substitution variable, the variable you refer <em>to</em> must come <em>after</em> where you refer to it. This is why in this case &#8220;topic=<span style="white-space: pre-wrap;">//Your&#32;Topic//</span>&#8221; comes <em>after</em> &#8220;heading=++++ {$topic}&#8221;</span></p> <h4><span>In Your Page Source</span></h4> <table style="border-collapse:collapse;border-top:2px solid;border-bottom:2px solid"> <tr> <td style="padding:3px 1em 3px 0"><em><strong>What you type &#8230;</strong></em></td> <td><em><strong>What you get&#8230;</strong></em></td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code> [[include front-end]]]</code></pre></div> </td> <td> <h4><span><em>Your Topic</em></span></h4> <p>A description for &#8220;<em>Your Topic</em>&#8221; follows &#8230;</p> </td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code> [[include front-end topic=Internet]]]</code></pre></div> </td> <td> <h4><span>Internet</span></h4> <p>A description for &#8220;Internet&#8221; follows &#8230;</p> </td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code> [[include front-end topic=* | heading=+ Asterisk]]</code></pre></div> </td> <td> <h1><span>Asterisk</span></h1> <p>A description for &#8220;*&#8221; follows &#8230;</p> </td> </tr> <tr style="border-top:1px solid"> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code> [[include front-end topic=Note | heading=//Note://]]</code></pre></div> </td> <td> <p><em>Note:</em><br /> A description for &#8220;Note&#8221; follows &#8230;</p> </td> </tr> </table> <h4><span>Tricky Examples</span></h4> <p>Without knowing its value, you can refer to, and extend a default value:</p> <table> <tr> <td style="padding:3px 1em 3px 0"> <div class="code"> <pre><code> [[include front-end topic=Wikidot | heading={$heading} -- better]]]</code></pre></div> </td> <td> <h4><span>Wikidot &#8212; better</span></h4> <p>A description for &#8220;Wikidot&#8221; follows &#8230;</p> </td> </tr> </table> <p>If you want a substitution variable to become <em>empty</em>, you might use &#8220;<em>parameter</em>=<span style="white-space: pre-wrap;">[!----]</span>&#8221;</p> <table> <tr> <td> <div class="code"> <pre><code> [[include front-end topic=Air | heading=[!----] ]]]</code></pre></div> </td> <td style="padding:1em"> <p>A description for &#8220;Air&#8221; follows &#8230;</p> </td> </tr> </table> <p>If you want a substitution variable which, on your include template, is defined on its own line, to be displayed <em>without</em> the line-break, use a trailing backslash (&#8220;\&#8221;) as in the following example.</p> <table> <tr> <td> <div class="code"> <pre><code> [[include front-end topic=Compact | heading=**Compact:** \ ]]]</code></pre></div> </td> <td style="padding:1em"> <p><strong>Compact:</strong> A description for &#8220;Compact&#8221; follows &#8230;</p> </td> </tr> </table> <h2><span>Author</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:erichsteinboeck">userPage</a>.</span></p> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://community.wikidot.com/wishlist:6</guid>
				<title>Random Page</title>
				<link>http://community.wikidot.com/wishlist:6</link>
				<description>

&lt;h1&gt;&lt;span&gt;Description&lt;/span&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;It would be nice to display a random page when clicking on a menu link
&lt;ul&gt;
&lt;li&gt;with a list of categories of pages not to be displayed (nav: system: &amp;#8230;)&lt;/li&gt;
&lt;li&gt;with an option for a particular category (quizz: )&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;It would be nice to have it also in the [[include &amp;#8230; ]] command:
&lt;ul&gt;
&lt;li&gt;[[include RandomPage category=&amp;quot;cat1, cat2&amp;quot;]]&lt;/li&gt;
&lt;li&gt;[[include RandomPage category=&amp;quot;ALL&amp;quot; except=&amp;quot;nav: system:&amp;quot;]&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;It would be nice to have a random order element for use in ListPages&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span&gt;Links to forum Posts&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://community.wikidot.com/forum/t-10541/random-start-page&quot;&gt;http://community.wikidot.com/forum/t-10541/random-start-page&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://community.wikidot.com/forum/t-17138/random-page-generation&quot;&gt;http://community.wikidot.com/forum/t-17138/random-page-generation&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://community.wikidot.com/forum/t-25248/random-pages&quot;&gt;http://community.wikidot.com/forum/t-25248/random-pages&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://community.wikidot.com/forum/t-62986/&quot;&gt;http://community.wikidot.com/forum/t-62986/&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Workaround&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Have a look at &lt;a href=&quot;http://snippets.wikidot.com/code:choose-a-page&quot;&gt;http://snippets.wikidot.com/code:choose-a-page&lt;/a&gt;, a clever snippet by&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=7925&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;ErichSteinboeck&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=7925)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/erichsteinboeck&quot;  &gt;ErichSteinboeck&lt;/a&gt;&lt;/span&gt;. &lt;span style=&quot;font-size:smaller;&quot;&gt;Please visit his/her &lt;a href=&quot;http://community.wikidot.com/user:erichsteinboeck&quot;&gt;userPage&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Suggested by&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=3370&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;gerdami&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=3370)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;gerdami&lt;/a&gt;&lt;/span&gt;. &lt;span style=&quot;font-size:smaller;&quot;&gt;Please visit his/her &lt;a href=&quot;http://community.wikidot.com/user:gerdami&quot;&gt;userPage&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;by &lt;span class=&quot;printuser avatarhover&quot;&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;&lt;img class=&quot;small&quot; src=&quot;http://www.wikidot.com/avatar.php?userid=3370&amp;amp;amp;size=small&amp;amp;amp;timestamp=1778818751&quot; alt=&quot;gerdami&quot; style=&quot;background-image:url(http://www.wikidot.com/userkarma.php?u=3370)&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.wikidot.com/user:info/gerdami&quot;  &gt;gerdami&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 15 May 2008 19:33:31 +0000</pubDate>
												<content:encoded>
					<![CDATA[
						 <h1><span>Description</span></h1> <ul> <li>It would be nice to display a random page when clicking on a menu link <ul> <li>with a list of categories of pages not to be displayed (nav: system: &#8230;)</li> <li>with an option for a particular category (quizz: )</li> </ul> </li> <li>It would be nice to have it also in the [[include &#8230; ]] command: <ul> <li>[[include RandomPage category=&quot;cat1, cat2&quot;]]</li> <li>[[include RandomPage category=&quot;ALL&quot; except=&quot;nav: system:&quot;]</li> </ul> </li> <li>It would be nice to have a random order element for use in ListPages</li> </ul> <h2><span>Links to forum Posts</span></h2> <p><a href="http://community.wikidot.com/forum/t-10541/random-start-page">http://community.wikidot.com/forum/t-10541/random-start-page</a><br /> <a href="http://community.wikidot.com/forum/t-17138/random-page-generation">http://community.wikidot.com/forum/t-17138/random-page-generation</a><br /> <a href="http://community.wikidot.com/forum/t-25248/random-pages">http://community.wikidot.com/forum/t-25248/random-pages</a><br /> <a href="http://community.wikidot.com/forum/t-62986/">http://community.wikidot.com/forum/t-62986/</a></p> <h2><span>Workaround</span></h2> <p>Have a look at <a href="http://snippets.wikidot.com/code:choose-a-page">http://snippets.wikidot.com/code:choose-a-page</a>, a clever snippet by</p> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/erichsteinboeck" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=7925&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="ErichSteinboeck" style="background-image:url(http://www.wikidot.com/userkarma.php?u=7925)" /></a><a href="http://www.wikidot.com/user:info/erichsteinboeck" >ErichSteinboeck</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:erichsteinboeck">userPage</a>.</span></p> <h2><span>Suggested by</span></h2> <p><span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/gerdami" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=3370&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="gerdami" style="background-image:url(http://www.wikidot.com/userkarma.php?u=3370)" /></a><a href="http://www.wikidot.com/user:info/gerdami" >gerdami</a></span>. <span style="font-size:smaller;">Please visit his/her <a href="http://community.wikidot.com/user:gerdami">userPage</a>.</span></p> <hr /> <p>by <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/gerdami" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=3370&amp;amp;size=small&amp;amp;timestamp=1778818751" alt="gerdami" style="background-image:url(http://www.wikidot.com/userkarma.php?u=3370)" /></a><a href="http://www.wikidot.com/user:info/gerdami" >gerdami</a></span></p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>