<?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>Lars Schenk &#187; Scriptaculous</title>
	<atom:link href="http://lars-schenk.com/tag/scriptaculous/feed" rel="self" type="application/rss+xml" />
	<link>http://lars-schenk.com</link>
	<description>IT-Services :: Software-Development since 1980 :: Freelancer since 1988</description>
	<lastBuildDate>Thu, 10 Jun 2010 22:51:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Kategorie Widget für WordPress</title>
		<link>http://lars-schenk.com/kategorie-widget-fuer-wordpress/132</link>
		<comments>http://lars-schenk.com/kategorie-widget-fuer-wordpress/132#comments</comments>
		<pubDate>Thu, 02 Aug 2007 10:35:13 +0000</pubDate>
		<dc:creator>Lars Schenk</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[tech-recipes]]></category>
		<category><![CDATA[Scriptaculous]]></category>
		<category><![CDATA[Widget]]></category>

		<guid isPermaLink="false">http://lars-schenk.com/kategorie-widget-fuer-wordpress/132</guid>
		<description><![CDATA[Für ein WordPress basiertes Projekt soll eine umfangreiche Kategorie-Liste ansprechend präsentiert werden. Eine hohe Usability soll gewährleistet sein, so dass die Kategorie-Liste eine tragende Rolle bei der Navigation durch die Beiträge einnehmen kann.
Es sind einige Plugins im Umlauf, die die integrierte Kategorie-Liste von WordPress ersetzen und z.B. um aufklappbare Ordner erweitern. 
Fold Category List 1.12 [...]]]></description>
			<content:encoded><![CDATA[<p>Für ein WordPress basiertes Projekt soll eine umfangreiche Kategorie-Liste ansprechend präsentiert werden. Eine hohe Usability soll gewährleistet sein, so dass die Kategorie-Liste eine tragende Rolle bei der Navigation durch die Beiträge einnehmen kann.</p>
<p>Es sind einige Plugins im Umlauf, die die integrierte Kategorie-Liste von WordPress ersetzen und z.B. um aufklappbare Ordner erweitern. <span id="more-132"></span></p>
<p><a href="http://www.webspaceworks.com/resources/cat/wp-plugins/31/">Fold Category List 1.12</a> - Provides PHP functions to display a folding category tree.</p>
<p>Dieses Tool kommt ohne Widget daher und arbeitet ohne JavaScript. Es wird also zum Aufklappen eine Kategorie immer eine neue Seite geladen.</p>
<p>Genau diesen Nachteil adressiert das <a href="http://dragonflyeye.net/blog/javascript-collapsing-categories/">JavaScript Animated Collapsing Categories Widget</a>.</p>
<p>Diese Lösung basiert auf JavaScript - somit wird das Neuladen der Seite vermieden. Ausserdem wird ein Widget beigesteuert. Die Kompatibelität zu WordPress 2.2 scheint jedoch noch nicht gewährleistet zu sein. Der Autor schreibt dazu "NOTE Concerning WordPress 2.2: I have not upgraded my blog to 2.2 yet, and cannot speak to the compatibility of this plugin with WP2.2.  If you’ve tried it, please share with me your results!" Ich habe auch Probleme mit diesem Tool unter WP2.2 @Apache2, php5 gehabt, so dass ich mich einem anderen Tool zugewendet habe:</p>
<p><a href="http://www.silpstream.com/blog/wp-dtree/">WP-dTree</a></p>
<p>Leider ist auch hier die aktuelle WP-dTree Version 2.2 bereits etwas angestaubt (last update 10 July 2006) und wolle auf Anhieb nicht so recht mit WP 2.2 harmonieren. </p>
<p>WP-dTree Version 2.2 setzt auf <a href="http://www.silpstream.com/blog/wp-scriptaculous/">WP-Scriptaculous</a> auf, was vom Autoren ein Lösungsansatz ist unterschiedliche <a href="http://script.aculo.us/">Scriptaculous</a> Versionen zu handlen und die Installation für Scriptaculous-basierte Widgets zu vereinfachen. Ich denke aber, dass dieser zusätzliche Layer nur mehr Komplexibelität mit sich bringt, die nicht zwingend erforderlich ist. Sehr negativ finde ich auch, dass das Plugin Schreibrechte auf die .htaccess benötigt. Um den Problemen mit WP-Scriptaculous aus dem Weg zu gehen habe ich mich entschlossen auf WP-Scriptaculous zu verzichten.</p>
<p>Damit WP-dTree Version 2.2 auch ohne WP-Scriptaculous eingesetzt werden kann, habe ich an /wp-content/plugins/wp-dtree.php folgende Änderungen durchgeführt:</p>
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showPlainTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-3">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> !<span style="color:#0000FF;">$effon</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; update_option<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_dtree_options'</span>, <span style="color:#0000FF;">$wpdtreeopt</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;div id=<span style="color:#000099; font-weight:bold;">\"</span>message<span style="color:#000099; font-weight:bold;">\"</span> class=<span style="color:#000099; font-weight:bold;">\"</span>updated fade<span style="color:#000099; font-weight:bold;">\"</span>&gt;&lt;p&gt;"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;font color=<span style="color:#000099; font-weight:bold;">\"</span>red<span style="color:#000099; font-weight:bold;">\"</span>&gt;WP-dTree settings updated...&lt;/font&gt;&lt;br /&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;/p&gt;&lt;/div&gt;"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#008000;">/* LS change (Verzicht auf WP_Scriptaculous) | if ( get_option('wp_scriptaculous_installed') )*/</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; update_option<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'wp_dtree_options'</span>, <span style="color:#0000FF;">$wpdtreeopt</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;div id=<span style="color:#000099; font-weight:bold;">\"</span>message<span style="color:#000099; font-weight:bold;">\"</span> class=<span style="color:#000099; font-weight:bold;">\"</span>updated fade<span style="color:#000099; font-weight:bold;">\"</span>&gt;&lt;p&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;font color=<span style="color:#000099; font-weight:bold;">\"</span>red<span style="color:#000099; font-weight:bold;">\"</span>&gt;WP-dTree settings updated...&lt;/font&gt;&lt;br /&gt;"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;font color=<span style="color:#000099; font-weight:bold;">\"</span>red<span style="color:#000099; font-weight:bold;">\"</span>&gt;Effects are active...&lt;/font&gt;&lt;br /&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;/p&gt;&lt;/div&gt;"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#008000;">/* LS change (Verzicht auf WP_Scriptaculous) | else {</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; echo &quot;&lt;div id=\&quot;message\&quot; class=\&quot;updated fade\&quot;&gt;&lt;p&gt;&quot;;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; echo &quot;&lt;font color=\&quot;red\&quot;&gt;WP-Scriptaculous plugin was not detected.&lt;/font&gt;&lt;br /&gt;&quot;;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; echo &quot;&lt;font color=\&quot;red\&quot;&gt;Disable the effect and update again or install the plugin.&lt;/font&gt;&lt;br /&gt;&quot;;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; echo &quot;&lt;font color=\&quot;red\&quot;&gt;Update failed...&lt;/font&gt;&quot;;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; echo &quot;&lt;/p&gt;&lt;/div&gt;&quot;;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">} */</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In meinem Theme referenziere ich dann die erforderlichen Scriptaculous Dateien, die von WP aus mitgeliefert werden:</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!-- required <span style="color:#616100;">for</span> WP-dTree --&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script src=<span style="color:#FF0000;">"&lt;?php bloginfo('home');?&gt;/wp-includes/js/scriptaculous/prototype.js"</span> type=<span style="color:#FF0000;">"text/javascript"</span> language=<span style="color:#FF0000;">"JavaScript"</span>&gt;&lt;/script&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script src=<span style="color:#FF0000;">"&lt;?php bloginfo('home');?&gt;/wp-includes/js/scriptaculous/scriptaculous.js?load=effects"</span> type=<span style="color:#FF0000;">"text/javascript"</span> language=<span style="color:#FF0000;">"JavaScript"</span>&gt;&lt;/script&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!-- /required <span style="color:#616100;">for</span> WP-dTree --&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Wünschenswert wäre es übrigens, wenn hier eine AJAX basierte Lösung verfügbar wäre, da somit auch bei umfangreicheren Kategorie-Listen geringere Ladezeiten realisierbar wären.</p>
<p>Last but not least fehlt dem WP-dTree ein Widget so dass es statisch in das Theme eingebunden werden müsste um es zu nutzen. Ich habe mir daher ein einfaches Widget gebaut, welches als Layer um den Funktions-Aufruf für die Kategorie-Liste gelegt wird. Ich habe es lsdtree genannt und sie können es <a href="/wp-content/plugins/widgets/lsdtree.zip">hier downloaden</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lars-schenk.com/kategorie-widget-fuer-wordpress/132/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
