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

<channel>
	<title>Nicolas Kuttler &#187; howto</title>
	<atom:link href="http://www.nkuttler.de/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nkuttler.de</link>
	<description>WordPress Services, IT Services</description>
	<lastBuildDate>Wed, 28 Jul 2010 23:49:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Samsung ML-1610 on Debian GNU/Linux</title>
		<link>http://www.nkuttler.de/2010/06/30/samsung-ml-1610-driver-linux/</link>
		<comments>http://www.nkuttler.de/2010/06/30/samsung-ml-1610-driver-linux/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 15:00:24 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://nkuttler.wordpress-server.de/?p=1772</guid>
		<description><![CDATA[I bought this printer a long time ago and it was connected to my Mac until that box died. I tried to install it once but never tried again after I didn&#8217;t get it to work in less than five minutes. Well, this time I did invest like ten minutes and it works just fine. [...]]]></description>
			<content:encoded><![CDATA[<p>I bought this printer a long time ago and it was connected to my Mac until that box died. I tried to install it once but never tried again after I didn&#8217;t get it to work in less than five minutes. Well, this time I did invest like ten minutes and it works just fine.<span id="more-1772"></span></p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># apt-get install cups splix</pre></div></div>

<p>Then go to the CUPS admin site at <tt>http://localhost:631/</tt> and then <tt>Administration</tt>, <tt>Add new Printer</tt>, click through and select the splix driver for the ML-1610. That&#8217;s all. <img src='http://www.nkuttler.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I think the first time I tried I just hadn&#8217;t installed the splix driver&#8230; which is easy enough to find:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ apt-cache search samsung driver</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/06/30/samsung-ml-1610-driver-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password protecting the wp-admin directory</title>
		<link>http://www.nkuttler.de/2010/06/14/htaccess-protect-wordpress-admin/</link>
		<comments>http://www.nkuttler.de/2010/06/14/htaccess-protect-wordpress-admin/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 13:16:07 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1584</guid>
		<description><![CDATA[Several places recommend to block the WordPress admin area with a password. While this certainly is a good idea, implementing it properly is non-trivial. One of the problems is that the WordPress Ajax handler script is located in the admin directory. So password-protecting the admin area will break all Ajax functionality your blog might be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codex.wordpress.org/Hardening_WordPress">Several</a> <a href="http://wordpress.tv/2009/07/11/brad-williams-security-montreal09/">places</a> recommend to block the WordPress admin area with a password. While this certainly is a good idea, implementing it properly is non-trivial. <span id="more-1584"></span></p>
<p>One of the problems is that the WordPress Ajax handler script is located in the admin directory. So password-protecting the admin area will break all Ajax functionality your blog might be using.</p>
<p>First, see <a href="http://httpd.apache.org/docs/2.2/howto/auth.html">this tutorial</a> on how to password protect directories with an <tt>.htaccess</tt> file. <a href="http://sivel.net">Sivel</a> has an <a href="http://core.trac.wordpress.org/ticket/12400#comment:23">example</a> for whitelisting the Ajax handler, add these line to your <tt>.htaccess</tt> file:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># These are the lines that do the password protection.</span>
<span style="color: #adadad; font-style: italic;"># You probably already created them while reading through the tutorial linked above.</span>
<span style="color: #00007f;">AuthUserFile</span> /path/to/your/htpasswd
<span style="color: #00007f;">AuthType</span> basic
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Restricted Resource&quot;</span>
<span style="color: #00007f;">require</span> valid-<span style="color: #00007f;">user</span>
&nbsp;
<span style="color: #adadad; font-style: italic;"># This is the whitelisting of the ajax handler</span>
&lt;<span style="color: #000000; font-weight:bold;">Files</span> admin-ajax.php&gt;
    <span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
    <span style="color: #00007f;">Allow</span> <span style="color: #00007f;">from</span> <span style="color: #00007f;">all</span>
    <span style="color: #00007f;">Satisfy</span> any 
&lt;/<span style="color: #000000; font-weight:bold;">Files</span>&gt;</pre></div></div>

<p>Please notice that you absolutely need to create the <tt>htpasswd</tt> file, see the linked tutorial above.</p>
<p>Here&#8217;s the necessary configuration to whitelist a file in a password protected location in lighttpd:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$HTTP</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;url&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=~</span> <span style="color: #ff0000;">&quot;^<span style="color: #000099; font-weight: bold;">\/</span>wp-admin<span style="color: #000099; font-weight: bold;">\/</span>.*&quot;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$HTTP</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;url&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!~</span> <span style="color: #ff0000;">&quot;^<span style="color: #000099; font-weight: bold;">\/</span>wp-admin<span style="color: #000099; font-weight: bold;">\/</span>admin-ajax<span style="color: #000099; font-weight: bold;">\.</span>php&quot;</span> <span style="color: #009900;">&#123;</span>
        auth<span style="color: #339933;">.</span><span style="color: #000066;">require</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
            <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>
                <span style="color: #ff0000;">&quot;method&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;basic&quot;</span><span style="color: #339933;">,</span>
                <span style="color: #ff0000;">&quot;realm&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;Password protected area&quot;</span><span style="color: #339933;">,</span>
                <span style="color: #ff0000;">&quot;require&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;user=theuser&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/06/14/htaccess-protect-wordpress-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add support for navigation menus to your WordPress theme</title>
		<link>http://www.nkuttler.de/2010/06/08/wp_nav_menu-wordpress-3-0/</link>
		<comments>http://www.nkuttler.de/2010/06/08/wp_nav_menu-wordpress-3-0/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 15:00:50 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress theme]]></category>
		<category><![CDATA[wp_nav_menu]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1613</guid>
		<description><![CDATA[The new navigation menus system in WordPress 3.0 looks promising, but in my opinion it&#8217;s not very usable yet. Anyway, here&#8217;s one way to add navigation menus to your theme while maintaining backward compatibility: In your theme&#8217;s functions.php add something like the following code: 1 2 3 4 5 6 7 8 9 10 11 [...]]]></description>
			<content:encoded><![CDATA[<p>The new <a href="http://codex.wordpress.org/Appearance_Menus_SubPanel">navigation menus</a> system in WordPress 3.0 looks promising, but in my opinion it&#8217;s not very usable yet. Anyway, here&#8217;s one way to add navigation menus to your theme while maintaining backward compatibility:</p>
<p>In your theme&#8217;s <code>functions.php</code> add something like the following code:<span id="more-1613"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mytheme_addmenus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	register_nav_menus<span style="color: #009900;">&#40;</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'main_nav'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'The Main Menu'</span><span style="color: #339933;">,</span>
		<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mytheme_addmenus'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> mytheme_nav<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_nav_menu'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        wp_nav_menu<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'menu=main_nav&amp;container_class=pagemenu&amp;fallback_cb=mytheme_nav_fallback'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">else</span>
        mytheme_nav_fallback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> mytheme_nav_fallback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    wp_page_menu<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'show_home=Start&amp;menu_class=pagemenu'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>In line 1 we add support for the navigation menus. The <code>mytheme_nav()</code> function is what you will use in the theme to display the menu. Inside that function we check if <code>wp_nav_menu()</code> exists, that means if we&#8217;re running WordPress 3.0 (or later). If not we&#8217;ll use the fallback function <code>mytheme_nav_fallback()</code>.</p>
<p>Notice that the fallback also gets called if no navigation menus have been created in the admin area. That&#8217;s what the <code>fallback_cb</code> parameter on line 4 does.</p>
<p>To keep the HTM markup and the CSS consistent you&#8217;ll have to use the <code>container_class</code> parameter on <code>wp_nav_menu</code> but the <code>menu_class</code> parameter for <code>wp_page_menu</code>.</p>
<p>In your template use the following code to use your new custom function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> mytheme_nav<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3>Resources</h3>
<ul>
<li><a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu">wp_nav_menu() reference</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/wp_page_menu">wp_page_menu() reference</a></li>
<li><a href="http://justintadlock.com/archives/2010/06/01/goodbye-headaches-hello-menus">Informative article on nav menus by Justin Tadlock</a></li>
</ul>
<a name="wptoc_0_0_0"></a><h2>Ramblings</h2>
<p>What&#8217;s good about the new menu system:</p>
<ul>
<li>Total control over what appears in the menu</li>
<li>You can add posts, pages, categories and tags in the menu</li>
<li>Very nice drag and drop interface</li>
</ul>
<p>What&#8217;s bad:</p>
<ul>
<li>You will have to teach your users how to use the system properly.</li>
<li>If you create new pages they won&#8217;t be added to your existing menu (except for top level pages).</li>
<li>You can not control your page menus through the navigation menus interface. I think it is&#8230; very very odd that WordPress doesn&#8217;t have a simple drag-and-drop interface to arrange pages.</li>
<li>The previous point means that the new menu system is useless unless you update your theme.</li>
<li>The <code>wp_nav_menu()</code> call is inconsistent with the existing <code>wp_page_menu()</code> function.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/06/08/wp_nav_menu-wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Change Typo3 template depending on column content</title>
		<link>http://www.nkuttler.de/2009/09/05/change-typo3-template-depending-on-column-content/</link>
		<comments>http://www.nkuttler.de/2009/09/05/change-typo3-template-depending-on-column-content/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 07:33:02 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[typoscript]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Webdesign]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de//?p=852</guid>
		<description><![CDATA[Let&#8217;s assume you don&#8217;t just want to inject some HTML if there is content in a column, but you want to use a completely different layout. This isn&#8217;t hard to accomplish, see the example: tmp.templateFile = COA tmp.templateFile &#123; 10 = COA 10 &#123; if.isFalse.numRows &#60; styles.content.getRight 10 = FILE 10 &#123; file = fileadmin/template/1col.html [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s assume you don&#8217;t just want to <a href="http://www.nkuttler.de//2009/05/24/change-template-if-content-exists-in-typo3/">inject some HTML</a> if there is content in a column, but you want to use a completely different layout. This isn&#8217;t hard to accomplish, see the example:<span id="more-852"></span></p>

<div class="wp_syntax"><div class="code"><pre class="typoscript" style="font-family:monospace;">tmp<span style="color: #339933; font-weight: bold;">.</span>templateFile <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">COA</span>
tmp<span style="color: #339933; font-weight: bold;">.</span>templateFile <span style="color: #009900;">&#123;</span>
	<span style="color: #cc0000;">10</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">COA</span>
	<span style="color: #cc0000;">10</span> <span style="color: #009900;">&#123;</span>
		<span style="font-weight: bold;">if</span><span style="color: #339933; font-weight: bold;">.</span>isFalse<span style="color: #339933; font-weight: bold;">.</span><span style="font-weight: bold;">numRows</span> <span style="color: #339933; font-weight: bold;">&lt;</span> <span style="color: #000066; font-weight: bold;">styles</span><span style="color: #339933; font-weight: bold;">.</span>content<span style="color: #339933; font-weight: bold;">.</span>getRight
		<span style="color: #cc0000;">10</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">FILE</span>
		<span style="color: #cc0000;">10</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">file</span> <span style="color: #339933; font-weight: bold;">=</span> fileadmin<span style="color: #339933; font-weight: bold;">/</span>template<span style="color: #339933; font-weight: bold;">/</span>1col<span style="color: #339933; font-weight: bold;">.</span>html
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #cc0000;">20</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">COA</span>
	<span style="color: #cc0000;">20</span> <span style="color: #009900;">&#123;</span>
		<span style="font-weight: bold;">if</span><span style="color: #339933; font-weight: bold;">.</span>isTrue<span style="color: #339933; font-weight: bold;">.</span><span style="font-weight: bold;">numRows</span> <span style="color: #339933; font-weight: bold;">&lt;</span> <span style="color: #000066; font-weight: bold;">styles</span><span style="color: #339933; font-weight: bold;">.</span>content<span style="color: #339933; font-weight: bold;">.</span>getRight
		<span style="color: #cc0000;">10</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">FILE</span>
		<span style="color: #cc0000;">10</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">file</span> <span style="color: #339933; font-weight: bold;">=</span> fileadmin<span style="color: #339933; font-weight: bold;">/</span>template<span style="color: #339933; font-weight: bold;">/</span>2col<span style="color: #339933; font-weight: bold;">.</span>html
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The <tt>if</tt>s check if there is or isn&#8217;t content in the right column and the <tt>COA</tt> returns the correct cObject, FILE in this case.</p>
<p>And then in your main typoscript something like:</p>

<div class="wp_syntax"><div class="code"><pre class="typoscript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">page</span><span style="color: #339933; font-weight: bold;">.</span>10<span style="color: #339933; font-weight: bold;">.</span>template <span style="color: #339933; font-weight: bold;">&lt;</span> tmp<span style="color: #339933; font-weight: bold;">.</span>templateFile</pre></div></div>

<p>instead of the more usual</p>

<div class="wp_syntax"><div class="code"><pre class="typoscript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">page</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #cc0000;">10</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">TEMPLATE</span>
	<span style="color: #cc0000;">10</span> <span style="color: #009900;">&#123;</span>
		template <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">FILE</span>
		template <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">file</span> <span style="color: #339933; font-weight: bold;">=</span> fileadmin<span style="color: #339933; font-weight: bold;">/</span>template<span style="color: #339933; font-weight: bold;">/</span>1col<span style="color: #339933; font-weight: bold;">.</span>html
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That&#8217;s all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2009/09/05/change-typo3-template-depending-on-column-content/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Change template if content exists in Typo3</title>
		<link>http://www.nkuttler.de/2009/05/24/change-template-if-content-exists-in-typo3/</link>
		<comments>http://www.nkuttler.de/2009/05/24/change-template-if-content-exists-in-typo3/#comments</comments>
		<pubDate>Sun, 24 May 2009 19:23:41 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[typoscript]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de//?p=729</guid>
		<description><![CDATA[If you build sites with Typo3 you might want to use a smart template that uses different markup for different pages. Of course you can define as many templates as you like in Typo3. But what if you want to use a two and a three-column layout, depending on if content in one column exists, [...]]]></description>
			<content:encoded><![CDATA[<p>If you build sites with Typo3 you might want to use a smart template that uses different markup for different pages. Of course you can define as many templates as you like in Typo3. But what if you want to use a two and a three-column layout, depending on if content in one column exists, and if you don&#8217;t know in advance if there is content in that column? The solution is rather easy, do something like in this example:<span id="more-729"></span></p>

<div class="wp_syntax"><div class="code"><pre class="typoscript" style="font-family:monospace;"><span style="color: #aaa; font-style: italic;"># Add a float if we have content in column 2</span>
foo <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">COA</span>
foo <span style="color: #009900;">&#123;</span>
	wrap <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #3366CC;">&lt;div&gt;</span><span style="color: #339933; font-weight: bold;">|</span><span style="color: #3366CC;">&lt;/div&gt;</span>
	<span style="color: #cc0000;">200</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">CONTENT</span>
	<span style="color: #cc0000;">200</span> <span style="color: #009900;">&#123;</span>
		table <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #000066; font-weight: bold;">tt_content</span>
		<span style="font-weight: bold;">select</span> <span style="color: #009900;">&#123;</span>
			where <span style="color: #339933; font-weight: bold;">=</span> colPos <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #cc0000;">2</span>
			orderBy <span style="color: #339933; font-weight: bold;">=</span> sorting
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #aaa; font-style: italic;"># conditional to test if content exists in column</span>
	<span style="font-weight: bold;">if</span><span style="color: #339933; font-weight: bold;">.</span>isTrue<span style="color: #339933; font-weight: bold;">.</span><span style="font-weight: bold;">numRows</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #aaa; font-style: italic;"># check current page page</span>
		pidInList <span style="color: #339933; font-weight: bold;">=</span> this
		<span style="color: #aaa; font-style: italic;"># in the table tt_content</span>
		table <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #000066; font-weight: bold;">tt_content</span>
		<span style="color: #aaa; font-style: italic;"># colPos = 2 (right)</span>
		<span style="font-weight: bold;">select</span><span style="color: #339933; font-weight: bold;">.</span>where <span style="color: #339933; font-weight: bold;">=</span> colPos<span style="color: #339933; font-weight: bold;">=</span><span style="color: #cc0000;">2</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This example shows a very simple flexible template using a float.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2009/05/24/change-template-if-content-exists-in-typo3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using any Debian box as a wireless access point</title>
		<link>http://www.nkuttler.de/2009/02/25/using-any-debian-box-as-wireless-access-point/</link>
		<comments>http://www.nkuttler.de/2009/02/25/using-any-debian-box-as-wireless-access-point/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 14:02:45 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[wlan]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de//?p=664</guid>
		<description><![CDATA[I just lost an hour trying to configure a Thinkpad T41 as a wireless access point. Most of that time was due to problems with the built-in wlan interface and a kernel recompile to use a prism54-based PCMCIA card. This is mostly a post to remind myself what to do, and how to do it [...]]]></description>
			<content:encoded><![CDATA[<p>I just lost an hour trying to configure a Thinkpad T41 as a wireless access point. Most of that time was due to problems with the built-in wlan interface and a kernel recompile to use a  prism54-based PCMCIA card. This is mostly a post to remind myself what to do, and how to do it on Debian. It&#8217;s not the first time I create an access point, but I do it so infrequently that I always forget something.<span id="more-664"></span></p>
<a name="wptoc_0_0_0"></a><h2>The NIC</h2>
<p>Make sure there&#8217;s a Linux driver for your network interface card. Make sure the card can be run in <tt>master</tt> mode.</p>
<a name="wptoc_0_0_1"></a><h2>DHCP</h2>
<p>The boxes that will connect need an IP. Install <tt>dhcp3-server</tt> and do something like this in <tt>/etc/dhcp3/dhcpd.conf</tt>:</p>
<pre>
[...]
option domain-name "192.168.6.0";
option domain-name-servers 192.168.6.1;
[...]
subnet 192.168.6.0 netmask 255.255.255.0 {
  range 192.168.6.10 192.168.6.15;
  option routers 192.168.6.1;
}
[...]
</pre>
<a name="wptoc_0_0_2"></a><h2>Configure the network</h2>
<p>Configure the interface so that it can be started with <tt>ifup</tt>. Usually you want the connected boxes to have access to whatever internet connection the access point has, so I enable forwarding and masquerading in <tt>/etc/network/interfaces</tt>:</p>
<pre>
iface eth1 inet static
    address 192.168.6.1
    netmask 255.255.255.0
    network 192.168.6.0
    wireless-mode master
    wireless-essid debianftw
    wireless-key1 s:12345
    post-up /bin/echo 1 &gt; /proc/sys/net/ipv4/ip_forward
    post-up /sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
    post-up /etc/init.d/dhcp3-server restart
</pre>
<p><tt>13245</tt> is the WEP password and the network will be called <tt>debianftw</tt>.</p>
<a name="wptoc_0_0_3"></a><h2>Optional: DNS</h2>
<p>You may want to have name servers for the connected boxes. A quick solution is to take those from your <tt>/etc/resolv.conf</tt> and to put them in your <tt>/etc/dhcp3/dhcpd.conf</tt>. There are other solutions, like a caching only DNS server.</p>
<a name="wptoc_0_0_4"></a><h2>Security</h2>
<p>WEP isn&#8217;t a very good encryption but it&#8217;s enough for me. You probably don&#8217;t want to run this setup for a long time, it&#8217;s really just some notes to get me started quickly. Maybe I&#8217;ll add more about security in an update.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2009/02/25/using-any-debian-box-as-wireless-access-point/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mailman, HTTP POST and 301 redirects</title>
		<link>http://www.nkuttler.de/2008/11/09/mailman-and-301-redirects/</link>
		<comments>http://www.nkuttler.de/2008/11/09/mailman-and-301-redirects/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 18:01:38 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mailman]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de//?p=426</guid>
		<description><![CDATA[Why my mailman admin interface stopped working. Nothing happened when I submitted any of the forms. And how I fixed it.]]></description>
			<content:encoded><![CDATA[<p>After changing my domain configuration a little (do 301 redirects from <tt>nkuttler.de</tt> to <tt>www.nkuttler.de/</tt> etc.) I noticed that my mailman web interface stopped working. I tried to moderate, change settings etc., but once the form was submitted nothing happened.<span id="more-426"></span></p>
<p>After some digging I found the problem: 301 redirects don&#8217;t pass POST parameters. And when I configured the mailing list I set the domain to <tt>nkuttler.de</tt>. So mailman sets the form action to <tt>http://nkuttler.de/foo/bar</tt>, this gets redirected to the correct domain, but the POST data is gone. How do you change the web host? I couldn&#8217;t find anything in the admin interface, it looks like you have to do it on the command line.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mailman<span style="color: #000000; font-weight: bold;">/</span>bin
.<span style="color: #000000; font-weight: bold;">/</span>withlist <span style="color: #660033;">-l</span> <span style="color: #660033;">-r</span> fix_url list <span style="color: #660033;">-u</span> www.nkuttler.de<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>This is the precise command for <a href="http://www.debian.org">Debian</a>, on other distros you&#8217;ll have to find the correct location.</p>
<p><b>Update</b>: I&#8217;m not quite sure how I missed it, but the <tt>host_name</tt> parameter should allow you to change this setting as well. For other questions about the default URL you can also read the <a href="http://wiki.list.org/pages/viewpage.action?pageId=4030592">Where can I change a list or the default URL used for the web interface?</a> FAQ entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2008/11/09/mailman-and-301-redirects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Typo3 in 15 minutes</title>
		<link>http://www.nkuttler.de/2008/10/18/typo3-in-15-minutes/</link>
		<comments>http://www.nkuttler.de/2008/10/18/typo3-in-15-minutes/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 08:03:56 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[typoscript]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de//?p=232</guid>
		<description><![CDATA[Ok, the title is a little exaggerated. You&#8217;ll need to install Typo3 yourself and I assume that you can log into the backend. But if those are given, you&#8217;re pretty close to creating your first Typo3 site. In the backend, go into the Web-&#62;Page view. Click on the small world icon in the tree view [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, the title is a little exaggerated. You&#8217;ll need to install Typo3 yourself and I assume that you can log into the backend. But if those are given, you&#8217;re pretty close to creating your first Typo3 site.<span id="more-232"></span></p>
<p>In the backend, go into the <tt>Web-&gt;Page</tt> view. Click on the small world icon in the tree view (the second column). Click on <tt>New</tt>. The main column will give you a few choices, you want to create a <tt>Page (inside)</tt>.</p>
<p>After that you will see the page information for your new page in the main column at the right. Uncheck the <tt>Hide page</tt> box. Fill in some <tt>Pagetitle</tt>, I like to call my first page siteroot for various reasons I won&#8217;t be going into right now. That&#8217;s it, click on the save &amp; close icon (a floppy with an x). Great! You have created your first page.</p>
<p>The new page should appear in the tree view (click on the small plus next to the world icon). Then click on your new page, this time click on the name, not the icon. The main colum will show various columns for page content. Click on <tt>Create page content</tt> of the column <tt>Normal</tt>. Now you get a list of possible content elements, for now take a <tt>Regular text element</tt>.</p>
<p>Ok, now it&#8217;s time to fill your text content element with some text. In 4.2 you need to click on the <tt>Text</tt> tab, and the visual editor opens. Just type some random text in there. Click on save &amp; close. That&#8217;s it! You have created your first content!</p>
<p>This was all easy I hope. Now comes the harder part of Typo3, working with templates. I&#8217;ll take a simplistic approach. I use it in real life as well, but many people prefer using lots of markers or TemplaVoila. Ok, let&#8217;s go to the <tt>Web-&gt;Template</tt> section of the main navigation to the left. When you click on the link you should see the option <tt>Create template file for a new site</tt>. Choose that. If you don&#8217;t see it you may not be viewing the template for your first page but for the site.</p>
<p>Typo3 will ask you if you are sure you want to do this, and you&#8217;ll tell it &#8216;Hell yeah!&#8217;. You probably are in the <tt>Constant Editor</tt> now. Select <tt>Info/Modify</tt> from the dropdown menu. Then click on <tt>Click here to edit whole template record</tt>.</p>
<p>Here, you see some form fields. One of the is labeled <tt>Setup</tt>. Delete it&#8217;s useless content and paste this code into it:</p>

<div class="wp_syntax"><div class="code"><pre class="typoscript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">page</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">PAGE</span>
<span style="color: #000066; font-weight: bold;">page</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #cc0000;">10</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">HMENU</span>
	<span style="color: #cc0000;">10</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #aaa; font-style: italic;"># Throw in some primitive navigation</span>
		<span style="color: #aaa; font-style: italic;"># This is the first level</span>
		<span style="color: #cc0000;">1</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">TMENU</span>
  		<span style="color: #cc0000;">1</span> <span style="color: #009900;">&#123;</span>
        		expAll <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #cc0000;">1</span>
        		wrap <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #3366CC;">&lt;ul&gt;</span><span style="color: #339933; font-weight: bold;">|</span><span style="color: #3366CC;">&lt;/ul&gt;</span>
       			<span style="color: #990000; font-weight: bold;">NO</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #cc0000;">1</span>
        		<span style="color: #990000; font-weight: bold;">NO</span> <span style="color: #009900;">&#123;</span>
        			wrapItemAndSub <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #3366CC;">&lt;li&gt;</span><span style="color: #339933; font-weight: bold;">|</span><span style="color: #3366CC;">&lt;/li&gt;</span>
        		<span style="color: #009900;">&#125;</span>
        	<span style="color: #009900;">&#125;</span>
		<span style="color: #aaa; font-style: italic;"># Copy the first level to display a maximum of three levels</span>
        	<span style="color: #cc0000;">2</span> <span style="color: #339933; font-weight: bold;">&lt;</span> <span style="color: #339933; font-weight: bold;">.</span>1
        	<span style="color: #cc0000;">3</span> <span style="color: #339933; font-weight: bold;">&lt;</span> <span style="color: #339933; font-weight: bold;">.</span>1
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #aaa; font-style: italic;"># Insert the content from the Normal column</span>
	<span style="color: #cc0000;">20</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">CONTENT</span>
	<span style="color: #cc0000;">20</span> <span style="color: #009900;">&#123;</span>
		table <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #000066; font-weight: bold;">tt_content</span>
		<span style="font-weight: bold;">select</span> <span style="color: #009900;">&#123;</span>
			where <span style="color: #339933; font-weight: bold;">=</span> colPos <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #cc0000;">0</span>
			orderBy <span style="color: #339933; font-weight: bold;">=</span> sorting
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then click on the <tt>Includes</tt> tab. There&#8217;s an select field labeled <tt>Include static (from extensions):</tt> that contains an entry <tt>CSS Styled Content (css_styled_content)</tt>. Click on that entry.</p>
<p>That&#8217;s it, save your template! You can go to your site main URL now (not the backend) and see your first content page. One final note before you proceed: When you create new pages, make them all subpages of your first page. You should change your first page to be a shortcut to a page one level deeper that will act as your homepage.</p>
<p>Your next steps should be to read the docs at <a href="http://www.typo3.org">typo3.org</a>, <a href="http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/">TSref</a> and the <a href="http://wiki.typo3.org/">wiki</a>. There&#8217;s a lot more to learn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2008/10/18/typo3-in-15-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very simple Typo3 navigation</title>
		<link>http://www.nkuttler.de/2008/10/08/very-simple-typo3-navigation/</link>
		<comments>http://www.nkuttler.de/2008/10/08/very-simple-typo3-navigation/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 11:57:19 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[typoscript]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de//?p=211</guid>
		<description><![CDATA[Sometimes I get asked how to build a menu in Typo3. It&#8217;s really easy, but TSref isn&#8217;t very verbose. So here&#8217;s how to build a basic, valid Typo3 navigation: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I get asked how to build a menu in Typo3. It&#8217;s really easy, but <a href="http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/">TSref</a> isn&#8217;t very verbose. So here&#8217;s how to build a basic, valid Typo3 navigation: <span id="more-211"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="typoscript" style="font-family:monospace;">foo <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">HMENU</span>
foo <span style="color: #009900;">&#123;</span>
	<span style="color: #aaa; font-style: italic;"># I use this because I like to have one root page</span>
	<span style="color: #aaa; font-style: italic;"># that links to the first content page. All my</span>
	<span style="color: #aaa; font-style: italic;"># level 1 Pages are subpages of that page.</span>
	entryLevel <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #cc0000;">1</span>
	<span style="color: #aaa; font-style: italic;"># define the first level</span>
	<span style="color: #cc0000;">1</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #990000; font-weight: bold;">TMENU</span>
	<span style="color: #cc0000;">1</span> <span style="color: #009900;">&#123;</span>
		wrap <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #3366CC;">&lt;ul&gt;</span><span style="color: #339933; font-weight: bold;">|</span><span style="color: #3366CC;">&lt;/ul&gt;</span>
		<span style="color: #aaa; font-style: italic;"># Normal Style</span>
		<span style="color: #990000; font-weight: bold;">NO</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #cc0000;">1</span>
		<span style="color: #990000; font-weight: bold;">NO</span> <span style="color: #009900;">&#123;</span>
			wrapItemAndSub <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #3366CC;">&lt;li&gt;</span><span style="color: #339933; font-weight: bold;">|</span><span style="color: #3366CC;">&lt;/li&gt;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #aaa; font-style: italic;"># Style, if menu page is current page</span>
		<span style="color: #990000; font-weight: bold;">CUR</span> <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #cc0000;">1</span>
		<span style="color: #990000; font-weight: bold;">CUR</span> <span style="color: #009900;">&#123;</span>
			wrapItemAndSub <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #3366CC;">&lt;li&gt;</span><span style="color: #339933; font-weight: bold;">|</span><span style="color: #3366CC;">&lt;/li&gt;</span>
			ATagParams<span style="color: #339933; font-weight: bold;">=</span> class<span style="color: #339933; font-weight: bold;">=</span>&quot;cur&quot;
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #aaa; font-style: italic;"># Define one more level, create a copy of level 1</span>
	<span style="color: #cc0000;">2</span> <span style="color: #339933; font-weight: bold;">&lt;</span> <span style="color: #339933; font-weight: bold;">.</span>1
	<span style="color: #aaa; font-style: italic;"># add as many more levels as you need</span>
	<span style="color: #aaa; font-style: italic;"># 3 &lt; .1 etc.</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Replace foo with whatever marker or position in your TS array you want. If you want to do anything more fancy, you should really read <a href="http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/10/1/">the fine manual</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2008/10/08/very-simple-typo3-navigation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
