<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The CMS less traveled</title>
	<atom:link href="http://ichosemodx.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ichosemodx.wordpress.com</link>
	<description>...Why I chose MODx over Drupal (and all the rest), and how that has made all the difference</description>
	<lastBuildDate>Wed, 12 Oct 2011 20:40:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ichosemodx.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The CMS less traveled</title>
		<link>http://ichosemodx.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ichosemodx.wordpress.com/osd.xml" title="The CMS less traveled" />
	<atom:link rel='hub' href='http://ichosemodx.wordpress.com/?pushpress=hub'/>
		<item>
		<title>New MODx Blog</title>
		<link>http://ichosemodx.wordpress.com/2010/09/23/new-modx-blog/</link>
		<comments>http://ichosemodx.wordpress.com/2010/09/23/new-modx-blog/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 20:11:21 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[CMS selection]]></category>
		<category><![CDATA[MODx stuff]]></category>
		<category><![CDATA[Using MODx Revolution]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx blog]]></category>
		<category><![CDATA[modx revolution]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=298</guid>
		<description><![CDATA[My new MODx Revolution blog is now live at this address: http://www.cmslesstraveled.com/ So long WordPress, and thanks for all the good times we had.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=298&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My new MODx Revolution blog is now live at this address:</p>
<h2><a href="http://www.cmslesstraveled.com" target="_self">http://www.cmslesstraveled.com/</a></h2>
<p>So long WordPress, and thanks for all the good times we had.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=298&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/09/23/new-modx-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>
	</item>
		<item>
		<title>Publishing a resource from a draft copy (revised &#8211; now with TVs)</title>
		<link>http://ichosemodx.wordpress.com/2010/08/03/publishing-a-resource-from-a-draft-copy-revised-now-with-tvs/</link>
		<comments>http://ichosemodx.wordpress.com/2010/08/03/publishing-a-resource-from-a-draft-copy-revised-now-with-tvs/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 18:30:09 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[MODx stuff]]></category>
		<category><![CDATA[Using MODx Revolution]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx blog]]></category>
		<category><![CDATA[modx revolution]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=288</guid>
		<description><![CDATA[Lots of feedback on yesterday&#8217;s post, much of it to the effect of &#8220;call me back when you&#8217;ve got it working with Template Variables!&#8221; Alright then. In addition to syncing the TVs of the Draft resource with the Production resource, I&#8217;ve slightly changed the lines of code that dictate which fields NOT to update.  Yesterday [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=288&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Lots of feedback on yesterday&#8217;s post, much of it to the effect of &#8220;call me back when you&#8217;ve got it working with Template Variables!&#8221;</p>
<p>Alright then.<span id="more-288"></span></p>
<p>In addition to syncing the TVs of the Draft resource with the Production resource, I&#8217;ve slightly changed the lines of code that dictate which fields NOT to update.  Yesterday I knew that the &#8216;alias&#8217; field was probably not something we want the draft resource to change (both resources would then have the same alias, which is not allowed).  Today I realized the same thing is true (for me, at least) of the &#8220;Parent Resource&#8221; field.  Changing either Alias or Parent Resource would alter the URL of the production resource (when friendly URLs are used).</p>
<p>Here&#8217;s the newest-latest code for my plugin (changed stuff is bolded):</p>
<p><span style="color:#0000ff;">&lt;?php<br />
$pagetitle = $resource-&gt;get(&#8216;pagetitle&#8217;);<br />
<span style="color:#ff0000;">//if the &#8220;draft&#8221; flag is in the title AND the user &#8220;published&#8221; the draft</span><br />
if (<br />
(preg_match(&#8216;/\(draft-(?P&lt;id&gt;\d+)-\)/&#8217;, $pagetitle, $results ))&amp;&amp;<br />
($resource-&gt;get(&#8216;published&#8217;))<br />
) {<br />
<span style="color:#ff0000;">// the ID of the resource  to publish to</span><br />
$prodID = $results['id'];<br />
<span style="color:#ff0000;">// if $prodID represents a real &amp; published resource</span><br />
if ($prodResource = $modx-&gt;getObject(&#8216;modResource&#8217;,<br />
array(&#8216;id&#8217;=&gt;$prodID,&#8217;published&#8217;=&gt;1))) {<br />
</span><span style="color:#0000ff;"><strong>$newVals = $resource-&gt;toArray();<br />
$restrictedFields = array(&#8216;alias&#8217;=&gt;&#8221;,&#8217;parent&#8217;=&gt;&#8221;); //fields not to update<br />
$filteredVals = array_diff_key($newVals,$restrictedFields); </strong></span><span style="color:#0000ff;"><br />
$prodResource-&gt;fromArray(<strong>$filteredVals</strong>);<br />
</span><span style="color:#0000ff;"><br />
<span style="color:#ff0000;">//take out the &#8220;draft&#8221; token before setting pagetitle</span><br />
$prodResource-&gt;set(&#8216;pagetitle&#8217;, str_replace($results[0], &#8221;, $pagetitle));<br />
$prodResource-&gt;save();</span></p>
<p><span style="color:#0000ff;"><strong>$newTVs = $resource-&gt;getMany(&#8216;TemplateVars&#8217;);<br />
foreach ($newTVs as $TV) {<br />
$newval = $TV-&gt;getValue($resource-&gt;get(&#8216;id&#8217;));<br />
$TV-&gt;setValue($prodResource-&gt;get(&#8216;id&#8217;), $newval);<br />
$TV-&gt;save();</strong><br />
<strong>} </strong></span> <span style="color:#0000ff;"> </span></p>
<p><span style="color:#0000ff;"><span style="color:#0000ff;"> }</span><br />
<span style="color:#ff0000;">//unpublish the draft resource</span><br />
$resource-&gt;set(&#8216;published&#8217;, 0);<br />
$resource-&gt;save();<br />
}<br />
return;<br />
?&gt;</span></p>
<p>You can put any fields that you DON&#8217;T want updated into the $restrictedFields array(in my code they are array keys&#8230; if you don&#8217;t like that feel free to rewrite the PHP to your liking).</p>
<p>Try this out and let me know how it works.  I fully expect there to be glitches with TVs and in other places (it <em>can&#8217;t </em>be <em>this</em> easy, can it?)</p>
<p>I&#8217;ll probably continue to use this blog space as an RFC forum for this plugin, until such a time as it seems robust enough to actually submit as an add-on package.  Eventually I&#8217;d like to automate the &#8220;create a draft copy&#8221; process, add some permissions checking, and probably some other stuff I&#8217;m forgetting or haven&#8217;t thought of yet.  Meanwhile, the more of you that try it out, the better (hopefully) I&#8217;ll be able to make it.</p>
<p><span style="color:#0000ff;"><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/288/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=288&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/08/03/publishing-a-resource-from-a-draft-copy-revised-now-with-tvs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>
	</item>
		<item>
		<title>Updating a published resource from a draft copy</title>
		<link>http://ichosemodx.wordpress.com/2010/08/02/updating-a-published-resource-from-a-draft-copy/</link>
		<comments>http://ichosemodx.wordpress.com/2010/08/02/updating-a-published-resource-from-a-draft-copy/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 20:32:57 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[MODx stuff]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Using MODx Revolution]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx revolution]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=249</guid>
		<description><![CDATA[[[UPDATE:  A slightly updated version of the plugin code, with Template Variable syncing, has been posted here]] I know, I know: long-time-no-blog. I had told myself I wasn&#8217;t going to do any more blogging until I had my new and improved blog site set up on a MODx Revolution install.  But I finally broke down [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=249&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#ff0000;"><span style="color:#993300;">[[</span><strong><span style="color:#993300;">UPDATE</span></strong><span style="color:#993300;">:  A slightly updated version of the plugin code, with Template Variable syncing, has been posted </span></span><a href="http://ichosemodx.wordpress.com/2010/08/03/publishing-a-resource-from-a-draft-copy-revised-now-with-tvs/" target="_self"><span style="color:#993300;">here</span></a><span style="color:#993300;">]]</span></p>
<p>I know, I know: long-time-no-blog.</p>
<p>I had told myself I wasn&#8217;t going to do any more blogging until I had my new and improved blog site set up on a MODx Revolution install.  But I finally broke down today because</p>
<ol>
<li>Setting up the new website is taking a lot longer than expected (mostly due to a lack of spare time)</li>
<li>Today I did something so cool I can&#8217;t help but write about it.</li>
</ol>
<p><span id="more-249"></span>Today I made major inroads toward solving one of my longest-standing issues with MODx publishing:  the need to work on a &#8220;draft&#8221; copy of an already-published document, and publish from the &#8220;draft&#8221; copy to the published version.  In other words:</p>
<ul>
<li>A user creates and publishes a resource.</li>
<li>Later, the user needs to make &#8220;work-in-progress&#8221; revisions to the resource.  They are going to completely overhaul the original content, but it is going to take time, and they don&#8217;t want to publish the changes until they are ready.</li>
</ul>
<p><a href="http://ichosemodx.files.wordpress.com/2010/08/6a00d83451c0aa69e20105369e17d8970c-800wi.jpg"><img class="alignright size-medium wp-image-284" title="6a00d83451c0aa69e20105369e17d8970c-800wi" src="http://ichosemodx.files.wordpress.com/2010/08/6a00d83451c0aa69e20105369e17d8970c-800wi.jpg?w=300&#038;h=229" alt="" width="300" height="229" /></a>MODx (and most other CMSes, as far as I know) have a simple published/unpublished model.  If you publish a document, there is no easy way to &#8220;work on&#8221; that document without affecting the published version. (Because there is only one &#8216;version&#8217;).  As Shaun McCormick recently wrote to me,</p>
<blockquote><p>There&#8217;s a lot [involved in] workflow in CMSes, and to be frank, there&#8217;s a reason most CMSes don&#8217;t have it. It&#8217;s complex, and requires a lot of work.</p></blockquote>
<p>Fair enough.  As I&#8217;ve thought about this problem over the last six months or so, it seems that every potential solution turned out to be much more complicated than I thought it would be, to the point that it exceeded my abilities and grasp of the concepts.</p>
<p>I don&#8217;t know if its because I&#8217;ve learned a lot more about MODx, or if its because I&#8217;ve reduced the scope of what I&#8217;m trying to do.  (Probably a combination of both).  But over the weekend, a light went on in my head.  I realized that the only &#8220;workflow&#8221; concepts I really needed were:</p>
<ul>
<li>The ability to mark a resource as a &#8220;draft&#8221;</li>
<li>The ability to specify which resource it is a &#8220;draft&#8221; <em>of</em>. (To link it to a different, published resource).</li>
<li>The ability to (when desired) update the published resource with the revisions in the draft resource.</li>
</ul>
<p>Here&#8217;s what I came up with.  Its by no means perfect, but it does exactly what I need it to:</p>
<ol>
<li><strong>Create a &#8220;draft&#8221; copy of a published resource<br />
</strong>Start by just creating a copy, period. Click the &#8220;duplicate&#8221; button, and give it a title.<br />
<a href="http://ichosemodx.files.wordpress.com/2010/08/duplicate3.gif"><img class="alignnone size-full wp-image-259" title="duplicate" src="http://ichosemodx.files.wordpress.com/2010/08/duplicate3.gif?w=463&#038;h=299" alt="" width="463" height="299" /></a></p>
<p>Here I&#8217;ll use the same title as the original, but with &#8220;(draft)&#8221; appended.<br />
<a href="http://ichosemodx.files.wordpress.com/2010/08/duplicate-22.gif"><img class="alignnone size-full wp-image-262" title="duplicate-2" src="http://ichosemodx.files.wordpress.com/2010/08/duplicate-22.gif?w=310&#038;h=149" alt="" width="310" height="149" /></a><br />
That works well in the resource tree &#8211; you can pretty clearly see that resource #4 is a draft copy of resource #2.<br />
<strong><br />
</strong></li>
<li><strong>Unpublish the draft copy.</strong><br />
This is a <em>draft</em>, after all &#8211; the whole point is that it isn&#8217;t published. You don&#8217;t want it showing up in your menus and such.<br />
<a href="http://ichosemodx.files.wordpress.com/2010/08/duplicate-3.gif"><br />
<img class="alignnone size-full wp-image-261" title="duplicate-3" src="http://ichosemodx.files.wordpress.com/2010/08/duplicate-3.gif?w=295&#038;h=149" alt="" width="295" height="149" /></a></p>
<p>There &#8211; that&#8217;s better.</li>
<li><strong>Specify which published resource this is a draft of</strong><br />
To do this, I&#8217;m just going to add the resource ID of the published resource to the title of the draft resource.  The new title looks like this:<br />
<a href="http://ichosemodx.files.wordpress.com/2010/08/duplicate-4.gif"><img class="alignnone size-full wp-image-263" title="duplicate-4" src="http://ichosemodx.files.wordpress.com/2010/08/duplicate-4.gif?w=310&#038;h=149" alt="" width="310" height="149" /></a><br />
Note the dashes before and after the id: &#8220;(draft-2-)&#8221;.  In the next step I&#8217;m going to be parsing out the ID number from the title of the draft resource, so it is important to have a consistent &amp; recognizable pattern to search against. You can use any pattern you like, so long as you know how to write a regular expression to identify it and parse out the number.</li>
<li><strong>Write the plugin that does all the magic.</strong>What we need now is to capture the user&#8217;s intent to &#8220;promote&#8221; the draft copy to published status.  While working on the draft, the user can save over and over again to their liking, while the original resource remains unchanged. But when the user checks the &#8220;Published&#8221; box on the draft resource, that&#8217;s where we need some magic to happen.A MODx Plugin is a PHP script that is tied to a certain System Event. Here we want to tie in to the action of saving of a resource, and potentially (based on certain criteria) make changes to another resource (the production resource).In human terms, we want our Plugin to do this:
<ul>
<li>Run each time a resource is saved (&#8220;OnDocFormSave&#8221; is the name of the System Event).</li>
<li>Test for whether the resource is a &#8220;draft&#8221; resource AND whether the &#8220;Published&#8221; box was checked</li>
<li>If yes to both, then:
<ul>
<li>parse out the ID of the production resource from the title of the draft resource</li>
<li>update the production resource with all the content from the draft resource</li>
<li>save the production resource</li>
<li>&#8220;un-publish&#8221; the draft resource</li>
<li>save the draft resource</li>
</ul>
</li>
</ul>
<p>(Note: we need to &#8220;un-publish&#8221; the draft resource because we don&#8217;t really want the draft resource published; we are repurposing the &#8220;Published&#8221; checkbox to really mean &#8220;copy this in to production&#8221;).</p>
<p>Here&#8217;s what the plugin code looks like:<br />
<span style="color:#0000ff;">&lt;?php<br />
$pagetitle = $resource-&gt;get(&#8216;pagetitle&#8217;);<br />
<span style="color:#ff0000;"> //if the &#8220;draft&#8221; flag is in the title AND the user &#8220;published&#8221; the draft</span><br />
if (<br />
(preg_match(&#8216;/\(draft-(?P&lt;id&gt;\d+)-\)/&#8217;, $pagetitle, $results ))&amp;&amp;<br />
($resource-&gt;get(&#8216;published&#8217;))<br />
) {</span></p>
<p><span style="color:#ff0000;">// the ID of the resource  to publish to</span><br />
<span style="color:#0000ff;"> $prodID = $results['id'];</span></p>
<p><span style="color:#ff0000;"> // if this represents a real &amp; published resource</span><br />
<span style="color:#0000ff;"> if ($prodResource = $modx-&gt;getObject(&#8216;modResource&#8217;,<br />
array(&#8216;id&#8217;=&gt;$prodID,&#8217;published&#8217;=&gt;1))) {</span></p>
<p><span style="color:#ff0000;">// update the production resource with the values from the draft resource</span><br />
$prodResource-&gt;fromArray($resource-&gt;toArray());</p>
<p><span style="color:#ff0000;"> //take out the &#8220;draft&#8221; token before setting pagetitle</span><br />
<span style="color:#0000ff;"> $prodResource-&gt;set(&#8216;pagetitle&#8217;, str_replace($results[0], &#8221;, $pagetitle));</span></p>
<p><span style="color:#ff0000;">//save changes to the production resource</span><br />
<span style="color:#0000ff;">$prodResource-&gt;save();<br />
}</span></p>
<p><span style="color:#ff0000;"> //unpublish the draft resource</span><br />
<span style="color:#0000ff;"> $resource-&gt;set(&#8216;published&#8217;, 0);</span></p>
<p><span style="color:#ff0000;">//save changes to the draft resource</span><br />
<span style="color:#0000ff;">$resource-&gt;save();<br />
}<br />
return;<br />
?&gt;<br />
</span><br />
That &#8220;preg_match&#8221; business is what looks for my particular draft flag pattern &#8220;(draft-99-)&#8221;.<br />
<span style="color:#000000;">That just about does it. One more change to the code:  we can&#8217;t overwrite the &#8216;alias&#8217; of the production resource with the alias of the draft resource.  Since alias dictates the URL when friendly URLs are used, we probably don&#8217;t want to be messing with the alias of the production resource at all.  So we&#8217;ll have to modify the code to preserve the original alias:<br />
</span><br />
<span style="color:#0000ff;">&lt;?php<br />
$pagetitle = $resource-&gt;get(&#8216;pagetitle&#8217;);<br />
<span style="color:#ff0000;"> //if the &#8220;draft&#8221; flag is in the title AND the user &#8220;published&#8221; the draft</span><br />
if (<br />
(preg_match(&#8216;/\(draft-(?P&lt;id&gt;\d+)-\)/&#8217;, $pagetitle, $results ))&amp;&amp;<br />
($resource-&gt;get(&#8216;published&#8217;))<br />
) {<br />
</span><span style="color:#ff0000;">// the ID of the resource  to publish to</span><br />
<span style="color:#0000ff;"> $prodID = $results['id'];</span><br />
<span style="color:#ff0000;"> // if $prodID represents a real &amp; published resource</span><br />
if ($prodResource = $modx-&gt;getObject(&#8216;modResource&#8217;,<br />
array(&#8216;id&#8217;=&gt;$prodID,&#8217;published&#8217;=&gt;1))) {<br />
<strong><span style="color:#0000ff;">$prodAlias = $prodResource-&gt;get(&#8216;alias&#8217;); </span><span style="color:#ff0000;">// we&#8217;re gonna need this</span></strong> <span style="color:#0000ff;"> </span><br />
<span style="color:#ff0000;">// update the production resource with the values from the draft resource</span><br />
<span style="color:#0000ff;"> $prodResource-&gt;fromArray($resource-&gt;toArray());</span><br />
<strong><span style="color:#0000ff;">$prodResource-&gt;set(&#8216;alias&#8217;, $prodAlias);</span> <span style="color:#ff0000;"> // set alias back to original value;</span></strong><br />
<span style="color:#ff0000;">//take out the &#8220;draft&#8221; token before setting pagetitle</span><br />
<span style="color:#0000ff;">$prodResource-&gt;set(&#8216;pagetitle&#8217;, str_replace($results[0], &#8221;, $pagetitle));<br />
$prodResource-&gt;save();<br />
}</span><br />
<span style="color:#ff0000;"> //unpublish the draft resource</span><br />
<span style="color:#0000ff;">$resource-&gt;set(&#8216;published&#8217;, 0);<br />
$resource-&gt;save();<br />
}</span><br />
<span style="color:#0000ff;">return;<br />
?&gt;<br />
</span></li>
<li><strong>Tie the Plugin to the OnDocFormSave System Event</strong><br />
The plugin will only work if it is tied to the proper system event.  Here we need to tie it to &#8220;OnDocFormSave&#8221; which fires just after a resource is saved through the manager form:</p>
<p><a href="http://ichosemodx.files.wordpress.com/2010/08/plugin1.gif"><img class="alignnone size-full wp-image-274" title="plugin" src="http://ichosemodx.files.wordpress.com/2010/08/plugin1.gif?w=482&#038;h=108" alt="" width="482" height="108" /></a></p>
<p>[Side note: The "OnDocFormSave" event has a parameter called "resource", which refers to the resource being saved. That's where $resource gets its value in the first line of the plugin code.]</li>
</ol>
<p>There you have it.  Now whenever the draft copy is saved with the &#8220;Published&#8221; checkbox checked, the &#8220;production&#8221; copy will be synched with all the changes.</p>
<p>One thing this plugin won&#8217;t do (yet):  update Template Variables. I think I know to make that enhancement, but wanted to get this preliminary version out as soon as possible to solicit feedback.</p>
<p>So&#8230; let me know what you think.  Does anyone other than me see this as potentially useful?  Or see a better way of doing it?  Lets talk.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=249&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/08/02/updating-a-published-resource-from-a-draft-copy/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/08/6a00d83451c0aa69e20105369e17d8970c-800wi.jpg?w=300" medium="image">
			<media:title type="html">6a00d83451c0aa69e20105369e17d8970c-800wi</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/08/duplicate3.gif" medium="image">
			<media:title type="html">duplicate</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/08/duplicate-22.gif" medium="image">
			<media:title type="html">duplicate-2</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/08/duplicate-3.gif" medium="image">
			<media:title type="html">duplicate-3</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/08/duplicate-4.gif" medium="image">
			<media:title type="html">duplicate-4</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/08/plugin1.gif" medium="image">
			<media:title type="html">plugin</media:title>
		</media:content>
	</item>
		<item>
		<title>Its all happening&#8230;</title>
		<link>http://ichosemodx.wordpress.com/2010/05/04/its-all-happening/</link>
		<comments>http://ichosemodx.wordpress.com/2010/05/04/its-all-happening/#comments</comments>
		<pubDate>Tue, 04 May 2010 15:02:06 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[MODx stuff]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx blog]]></category>
		<category><![CDATA[modx revolution]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=226</guid>
		<description><![CDATA[Nothing remotely technical in this post&#8230; I&#8217;m taking a step back from that stuff, while I get ready to relocate this blog and settle on some long-term specific themes/topics that will keep my interest and serve the MODx community as well as the &#8220;trying to decide on a CMS&#8221; community. Stay tuned. Today, just some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=226&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Nothing remotely technical in this post&#8230; I&#8217;m taking a step back from that stuff, while I get ready to relocate this blog and settle on some long-term specific themes/topics that will keep my interest and serve the MODx community as well as the &#8220;trying to decide on a CMS&#8221; community. Stay tuned.</p>
<p><span id="more-226"></span><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='570' height='351' src='http://www.youtube.com/embed/k35cuOy1s-I?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span></p>
<p>Today, just some housekeeping and announcements&#8230; just an excuse to post and keep the blog from getting too stale.</p>
<p>No, I&#8217;m not moving to Morocco.  But <a href="http://codingpad.maryspad.com/" target="_blank">@einsteinsboi</a> is moving to New Zealand.  Best of luck with your move Mary.  Hope you stay active in MODx and keep contributing to the community when you can.</p>
<p>Jason Coward, aka <a href="http://modxcms.com/forums/index.php?action=profile;u=17" target="_blank">OpenGeek</a>, aka <a href="http://twitter.com/drumshaman" target="_blank">@drumshaman</a>, has a <a href="http://www.jasoncoward.com/" target="_blank">new blog</a>, and it is built on MODx Revolution.</p>
<p>Shaun McCormick, aka <a href="http://modxcms.com/forums/index.php?action=profile;u=7231" target="_blank">splittingred</a>, a.k.a. <a href="http://www.twitter.com/splittingred">@splittingred</a>, has a <a href="http://splittingred.com/" target="_blank">new blog</a>, and it is built on MODx Revolution.</p>
<p>I, a.k.a. me, a.k.a. <a href="http://twitter.com/jrotering" target="_blank">@jrotering</a>, still have this old blog, not built on MODx Revolution. (My new one will be though, for real).</p>
<p>Here&#8217;s an insightful little interview<a href="#fn1">*</a> with co-founder Ryan Thrash and core developer Jeff Whitfield about the past, present and future of MODx.  The interviewer is <a href="http://www.patrickortman.com/" target="_blank">Patrick Ortman</a>, one more cool and productive member of the ever-surprising MODx community.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='570' height='351' src='http://www.youtube.com/embed/u6yiktB1wUQ?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span>
<p>See? Lots going on in the MODx world.  It&#8217;s all happening.</p>
<p>Two monumental events coming up this month.   First is <a href="http://modxpo.modxcms.com/" target="_blank">MODxpo</a>, next week in Dallas.  The first official MODx user conference; the <a href="http://modxpo.modxcms.com/schedule.html" target="_blank">schedule</a> has been posted, and it looks excellent.   I&#8217;m really looking forward to meeting the <a href="http://modxpo.modxcms.com/speakers.html" target="_blank">core team</a> and many members of the great user community.  Looking forward to hanging out with<a href="http://www.noalarmmedia.com/" target="_blank"> my brother</a> for two days, and sharing a room for the first time since I was about 12 years old.  Should be good.  And also hoping to find time to meet a <a href="http://nielsendigital.com/about/">good friend</a> from the PHP community while in the Dallas area.</p>
<p>Second, of course, is the <a href="http://entertainment.gather.com/viewArticle.action?articleId=281474978202229" target="_blank">series finale of LOST</a>.  I&#8217;m totally psyched, and plan on going all out: having a party, hiring a babysitter to put the kids to bed and keep them upstairs at all costs, and trying to convince my wife to bake a cake <a href="http://www.flickr.com/photos/xdr_jon3sx/sets/72157623771522801/" target="_blank">like this</a>.  It will be like Superbowl Sunday &#8211; except that the best part won&#8217;t be the commercials.</p>
<p>What, you may ask, does LOST have to do with MODx?  I&#8217;m so glad you asked.  I didn&#8217;t realize the connections myself until I started writing this.  But LOST is all about connections and theories&#8230; so here are a few.</p>
<ul>
<li>Both have really groovy logos, with 4-letter names and interesting capitalization<br />
<a href="http://ichosemodx.files.wordpress.com/2010/05/lostlogo_.jpg"><img class="alignnone size-medium wp-image-229" title="LostLogo_" src="http://ichosemodx.files.wordpress.com/2010/05/lostlogo_.jpg?w=300&#038;h=169" alt="Lost logo" width="300" height="169" /></a><a href="http://ichosemodx.files.wordpress.com/2010/05/modx-logo-evolution1.png"><img class="alignnone size-medium wp-image-231" title="modx-logo-evolution" src="http://ichosemodx.files.wordpress.com/2010/05/modx-logo-evolution1.png?w=300&#038;h=76" alt="modx logo" width="300" height="76" /></a></li>
<li>Both projects started in 2004 and have come a long way from where they started.</li>
<li><a href="http://modxcms.com/about/blog/shaun-mccormick/" target="_blank">Shaun McCormick</a> and <a href="http://modxcms.com/about/blog/jcoward/">Jason Coward</a> are like the <a href="http://www.avclub.com/articles/losts-damon-lindelof-and-carlton-cuse,14231/" target="_blank">Carlton Cuse and Damon Lindelof </a>of MODx Revolution.</li>
<li>Therefore <a href="http://modxcms.com/about/blog/rthrash/" target="_blank">Ryan Thrash</a> = <a href="http://www.ted.com/index.php/talks/j_j_abrams_mystery_box.html" target="_blank">J.J. Adams</a></li>
<li>Both are really all about the community</li>
<li>In order to keep MODx running and stable, <a href="http://modxcms.com/about/blog/jgilmore/" target="_blank">Jay Gilmore</a> lives in a hatch and pushes a button every 108 minutes<a href="#fn2">**</a>.<br />
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='570' height='351' src='http://www.youtube.com/embed/4Vh1EW8enYc?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span></li>
</ul>
<p>That&#8217;s all I&#8217;ve got.</p>
<p>If you&#8217;re going to MODxpo, I&#8217;ll see you in Dallas next week.</p>
<p>If you&#8217;re not, then I&#8217;ll <em>see you in another life, brother</em><a href="#fn3">***</a>.</p>
<p>It&#8217;s all happening.</p>
<p>Namaste.</p>
<hr />
<p style="padding-left:30px;"><span style="color:#ffffff;">.</span></p>
<p style="padding-left:30px;"><span style="color:#ffffff;">.</span></p>
<p style="padding-left:30px;"><span style="color:#ffffff;">.</span></p>
<p style="padding-left:30px;"><a name="#fn1">*</a>I especially love the smooth R&amp;B music that comes in halfway through  the interview.  It would be really funny if, when Ryan is introduced at MODxpo, they find this song and play it as his theme music as he walks to the stage.</p>
<p style="padding-left:30px;"><a name="fn2">**</a> not actually true.</p>
<p style="padding-left:30px;"><a name="fn3">***</a>Unless you are actually, biologically, my brother. In which case I&#8217;ll see you in Dallas.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=226&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/05/04/its-all-happening/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/05/lostlogo_.jpg?w=300" medium="image">
			<media:title type="html">LostLogo_</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/05/modx-logo-evolution1.png?w=300" medium="image">
			<media:title type="html">modx-logo-evolution</media:title>
		</media:content>
	</item>
		<item>
		<title>Managing CSS and Javascript/JQuery in MODx templates and pages &#8211; Part One</title>
		<link>http://ichosemodx.wordpress.com/2010/04/16/managing-css-and-javascriptjquery-in-modx-templates-and-pages-part-one/</link>
		<comments>http://ichosemodx.wordpress.com/2010/04/16/managing-css-and-javascriptjquery-in-modx-templates-and-pages-part-one/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 20:36:23 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Using MODx Revolution]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx blog]]></category>
		<category><![CDATA[modx revolution]]></category>
		<category><![CDATA[modx templates]]></category>
		<category><![CDATA[template variables]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=204</guid>
		<description><![CDATA[An interesting bit of discussion on Twitter today about jQuery rotating image galleries for MODx got me thinking about the way I&#8217;ve designed my templates to handle custom jQuery at the per-page level.  Long-time readers from back-in-the-day (by which I mean February) will recall that this was one of my high-priority issues for using MODx [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=204&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>An interesting bit of discussion on Twitter today about jQuery rotating image galleries for MODx got me thinking about the way I&#8217;ve designed my templates to handle custom jQuery at the per-page level.  Long-time readers from back-in-the-day (by which I mean February) will recall that this was<a href="http://ichosemodx.wordpress.com/2010/02/09/top-ten-big-things-i-hope-to-do-in-modx/" target="_self"> one of my high-priority issues</a> for using MODx Revolution.  While I don&#8217;t quite have it all sorted out yet, I think I&#8217;m on the right track.</p>
<p><span id="more-204"></span></p>
<p>My goal with jQuery (and also CSS) is to provide customization opportunities at both the template level and at the individual page level.  For me this ties in with my <a href="http://ichosemodx.wordpress.com/2010/04/12/thoughts-on-developing-a-template-strategy-and-my-new-template-click-through-utility/" target="_self">overall template strategy</a>, namely that all my templates will use the same chunk structure (with the variation coming via different properties passed to the chunk, and also via template variables).</p>
<p>Lets dive right in and take a look at my chunk &#8220;scriptsBlock&#8221;, which handles ALL of the javascript/jquery for EVERY template on my MODx installation:</p>
<p><span style="color:#888888;">&lt;!&#8211;start scripts_block &#8211;&gt;<br />
&lt;script src=&#8221;/assets/js/jquery-1.3.2.min.js&#8221; type=&#8221;text/javascript&#8221; charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;/assets/js/jquery.hoverIntent.minified.js&#8221; type=&#8221;text/javascript&#8221; charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;/assets/js/corners_modified.js&#8221; type=&#8221;text/javascript&#8221; charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;</span></p>
<p><span style="color:#888888;">[[$[[+customScriptsChunk]]]]<br />
[[javascript_includes]]<br />
[[customJQuery]]</span></p>
<p><span style="color:#888888;">&lt;!&#8211;end scripts_block &#8211;&gt;</span></p>
<p>The three &lt;script&gt; tags at the top are the &#8220;core&#8221; javascript that is integral to our overall web design. I think this translates to what Greg Smart refers to as being part of the &#8220;<a href="http://www.gregorysmart.com/2010/04/16/my-modx-template-strategy/" target="_blank">structural HTML</a>&#8220;.  Every template in my system will include those three script calls.</p>
<p>Now lets get in to the next part of the chunk &#8211; the MODx tags.  The first one looks like this:</p>
<p><span style="color:#888888;">[[$[[+customScriptsChunk]]]]</span></p>
<p><span style="color:#888888;"><span style="color:#000000;">This nested tag syntax may not be immediately recognizable to many of you, so lets walk through it.  Starting with the inner tag: </span></span></p>
<p><span style="color:#888888;"><span style="color:#000000;"><span style="color:#808080;">[[+customScriptsChunk]]</span></span></span></p>
<p>That syntax (<span style="color:#808080;">[[+</span>) is a "placeholder" tag in MODx.  It represents a value that will be swapped in upon being specified elsewhere. In this case, being that it is inside the chunk "scriptsBlock", it can be specified in the call to "scriptsBlock".</p>
<p><span style="color:#808080;">[[$scriptsBlock]]  <span style="color:#333333;">// call to &#8220;scriptsBlock&#8221; chunk with regular syntax</span></span></p>
<p><span style="color:#808080;">[[$scriptsBlock? &amp;customScriptsChunk=`myJavascriptChunk`]]  <span style="color:#333333;">// call to &#8220;scriptsBlock&#8221; chunk with a property passed.</span></span></p>
<p>When a chunk is passed a property which corresponds with a [[+placeholder]] tag in the chunk, the passed value is simply substituted in.  Thus <span style="color:#808080;">[[+customScriptsChunk]]</span> becomes &#8216;<span style="color:#808080;">myJavascriptChunk</span>&#8216;.  Thus</p>
<p><span style="color:#808080;">[[$[[+customScriptsChunk]]]]</span></p>
<p>becomes</p>
<p><span style="color:#808080;">[[$myJavascriptChunk]]</span></p>
<p>&#8230; a simple chunk call, referring to a chunk that presumably holds some additional javascript.</p>
<p>If no matching property was passed in the chunk call, the placeholder simply disappears during parsing.</p>
<p>Are you starting to see how this works?  Lets say I need to create a new template to be used on pages with lots of tables in them (data tables! full of tabular data! not the other evil kind!).  I want to be able to use the <a href="http://tablesorter.com/docs/" target="_blank">jQuery tablesorter</a> so that users are able to sort these tables by column. I&#8217;ll create a chunk called &#8220;tablesorter&#8221; that simply calls that script:</p>
<p><span style="color:#808080;">&lt;script  src=&#8221;/assets/js/jquery.tablesorter.js&#8221; type=&#8221;text/javascript&#8221;  charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;</span></p>
<p><span style="color:#808080;"><span style="color:#000000;">Then in my new template, I simply refer to &#8216;tablesorter&#8217; when calling <span style="color:#808080;">[[$scriptsBlock]] <span style="color:#000000;">in my template.</span><br />
</span></span></span></p>
<p><span style="color:#808080;">[[$scriptsBlock?  &amp;customScriptsChunk=`tablesorter`]]</span></p>
<p><span style="color:#808080;"><span style="color:#000000;">All pages that use this template will get the &#8220;core&#8221; script calls AND the tablesorter script call:</span></span></p>
<p><span style="color:#808080;">&lt;!&#8211;start  scripts_block &#8211;&gt;<br />
&lt;script src=&#8221;/assets/js/jquery-1.3.2.min.js&#8221;  type=&#8221;text/javascript&#8221; charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;<br />
&lt;script  src=&#8221;/assets/js/jquery.hoverIntent.minified.js&#8221; type=&#8221;text/javascript&#8221;  charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;<br />
&lt;script  src=&#8221;/assets/js/corners_modified.js&#8221; type=&#8221;text/javascript&#8221;  charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;</span></p>
<p><span style="color:#808080;">&lt;script   src=&#8221;/assets/js/jquery.tablesorter.js&#8221; type=&#8221;text/javascript&#8221;   charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;</span><br />
<span style="color:#808080;">[[javascript_includes]]<br />
[[customJQuery]]</span></p>
<p>&lt;!&#8211;end  scripts_block &#8211;&gt;</p>
<p><span style="color:#888888;"><span style="color:#000000;">In this way I create individual templates (or groups of templates) that inherit all of the core script calls and add some more of their own.</span></span></p>
<p><span style="color:#888888;"><span style="color:#000000;">The final two MODx tags </span></span></p>
<p><span style="color:#808080;">[[javascript_includes]]<br />
[[customJQuery]]</span></p>
<p><span style="color:#808080;"><span style="color:#333333;">&#8230;are for adding additional javascript and/or jQuery at the per-page level, using snippets and template variables. I&#8217;ll save those for another post.</span><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=204&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/04/16/managing-css-and-javascriptjquery-in-modx-templates-and-pages-part-one/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>
	</item>
		<item>
		<title>Thoughts on developing a template strategy&#8230; and my new template click-through utility</title>
		<link>http://ichosemodx.wordpress.com/2010/04/12/thoughts-on-developing-a-template-strategy-and-my-new-template-click-through-utility/</link>
		<comments>http://ichosemodx.wordpress.com/2010/04/12/thoughts-on-developing-a-template-strategy-and-my-new-template-click-through-utility/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 19:18:53 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Using MODx Revolution]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx blog]]></category>
		<category><![CDATA[modx revolution]]></category>
		<category><![CDATA[modx templates]]></category>
		<category><![CDATA[template variables]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=189</guid>
		<description><![CDATA[I&#8217;m keeping the sarcasm and clever wit to a minimum today, and putting out a request for comments. One of the things I&#8217;ve done in the process of working with MODx over the past few months is to create a rather elaborate and convoluted template schema.  Initially I was trying to keep everything to one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=189&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m keeping the sarcasm and clever wit to a minimum today, and putting out a request for comments.</p>
<p>One of the things I&#8217;ve done in the process of working with MODx over the past few months is to create a rather elaborate and convoluted template schema.  Initially I was trying to keep everything to one single, swiss-army-knife template.  That&#8217;s where the idea to use  a Template Variable to <a href="http://ichosemodx.wordpress.com/2010/02/21/one-template-multiple-page-layouts-exploring-the-power-of-template-variables/" target="_blank">select a content layout</a> came from.</p>
<p>That seemed promising, but as I went further down the road of One-Template-To-Rule-Them-All, I realized I was trying to wring some not-very-straightforward functionality out of MODx.   Things like &#8220;I need some Template Variables to be conditional upon other Template Variables&#8221;.  As in,  its great to be able to select &#8220;three column layout&#8221; in a TV, but unless I have additional TVs for &#8220;left column content&#8221; and &#8220;right column content&#8221;, I can&#8217;t do much with those additional columns.  But it doesn&#8217;t make sense to have &#8220;left column&#8221; and &#8220;right column&#8221; TVs on pages that don&#8217;t have those columns. Et cetera. I had begun to weave an overly-complicated web of confusion that was quickly collapsing upon me.</p>
<p>Thankfully the good folks on the MODx core team finally smacked some sense in to me in a response to a <a href="http://modxcms.com/forums/index.php/topic,47403.msg278664.html#msg278664" target="_blank">forum post</a>.  At this point I realized that the &#8220;one template&#8221; concept was a non-starter.</p>
<p>However.</p>
<p>I was still enamored with the overall concept that I think can best be described as &#8220;template inheritance&#8221;.  I knew that most of my templates would share 90% of their DNA, and only differ from each other slightly &#8211; a div here, an additional css file there.  I knew I wanted to keep code repetition to a minimum, and keep the templates themselves very clean and very rarely-needing-to-be-touched.</p>
<p>What I finally settled on was a highly nested chunk structure, with lots of placeholders for custom bits.  One big breakthrough was when I realized that you can pass arguments to a chunk that can then be used as placeholders within a nested chunk.  In other words:</p>
<p><span style="color:#808080;">[[$outerchunk? &amp;customdiv=`foo` &amp;customclass=`bar`]]</span></p>
<p>&#8216;outerchunk&#8217; looks like this:</p>
<p><span style="color:#808080;">&lt;div&gt;<br />
&lt;p&gt;some text&#8230;&lt;/p&gt;<br />
[[$innerchunk]] &lt;!&#8211;note how innerchunk doesn&#8217;t directly pass any arguments &#8211;&gt;<br />
&lt;/div&gt;</span></p>
<p>&#8230;and &#8216;innerchunk&#8217; looks like this:</p>
<p><span style="color:#808080;">&lt;div class=&#8221;[[+customclass]]&#8221;&gt;[[+customdiv]]&lt;/div&gt;</span></p>
<p>And the result looks like this:</p>
<p><span style="color:#808080;">&lt;div&gt;<br />
&lt;p&gt;some text&#8230;&lt;/p&gt;<br />
&lt;div class=&#8221;bar&#8221;&gt;foo&lt;/div&gt;<br />
&lt;/div&gt;</span></p>
<p>Now my template structure really started tightening up. I had arrived at something like this:</p>
<p><span style="color:#808080;">&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;[[*pagetitle]]&lt;/title&gt;<br />
[[$metaBlock]]<br />
[[$cssBlock? &amp;customCssChunk=`...`]]<br />
[[$scriptsBlock? &amp;customScriptsChunk=`...`]]<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
[[$header? &amp;customTopDesignChunk=`...` &amp;customHeaderChunk=`...`]]<br />
[[$content? &amp;navigationChunk=`...` &amp;contentLayout=`...`]]<br />
[[$footer? &amp;customFooterChunk=`...`]]<br />
&lt;/body&gt;<br />
&lt;/html&gt;</span></p>
<p>&#8230;which I then consolidated even further to look like this:</p>
<p><span style="color:#808080;">&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head&gt;<br />
[[$head? &amp;customCssChunk=`...`<br />
&amp;customScriptsChunk=``<br />
]]<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
[[$body? &amp;customTopDesignChunk=`wwwTopDesignBlock`<br />
&amp;customHeaderChunk=`wwwHeader`<br />
&amp;navigationChunk=`wwwNavigation`<br />
&amp;contentLayout=`25_50_25`<br />
&amp;customFooterChunk=`wwwFooter`<br />
]]<br />
&lt;/body&gt;<br />
&lt;/html&gt;</span></p>
<p>I&#8217;m currently debating whether to take the final step and just put the entire html structure into a single chunk:</p>
<p><span style="color:#808080;">[[$tplHTML &amp;customCssChunk=`...`<br />
&amp;customScriptsChunk=`...`<br />
&amp;customTopDesignChunk=`wwwTopDesignBlock`<br />
&amp;customHeaderChunk=`wwwHeader`<br />
&amp;navigationChunk=`wwwNavigation`<br />
&amp;contentLayout=`25_50_25`<br />
&amp;customFooterChunk=`wwwFooter`<br />
]]</span></p>
<p>I&#8217;m hesitant just because for some reason it comforts me to see a little bit of recognizable html in my templates&#8230; but really, this is probably the logical conclusion of the path I&#8217;ve gone down.  Code repetition is absolutely minimized; inheritance and extensibility are optimized.  Fully centralized control of the &#8220;common template family DNA&#8221;, and extremely customizable end pages, through a combination of custom chunks (as seen above) and template variables (for adding bits of css, jQuery, etc. on a per-page basis).  What could be better?</p>
<p>The downside?  An extremely convoluted chunk hierarchy that quickly makes my head hurt.</p>
<p>It started driving me nuts trying to visually parse these nested chunks, to see what bits of the final html source code where in which chunk.   I started to yearn for a quick way to grok my chunk nestings.</p>
<p>In the absence of any such utility, and at my wits&#8217; end, finally I was driven out of my inherent laziness and compelled to <a href="http://wwwnew.uwsa.edu/tplviewer.html" target="_blank">develop one</a>.</p>
<p>Behind that link is my rough first draft of a template click-through utility.  Currently it only expands chunks.  In the future I plan to enhance it to expand snippets, placeholders, etc.   But first I thought I&#8217;d solicit some feedback.  Is this something that anyone besides me would find useful?   As David Letterman would say, &#8220;<a href="http://www.youtube.com/watch?v=Sqa24iflv68&amp;feature=related" target="_blank">is this anything?</a>&#8220;</p>
<p>Take a look, and let me know what you think.  I&#8217;d appreciate any feedback whatsoever, either on the template viewer utility or on my convoluted template strategy.  If there is enough interest, I may do a future post on how the utility works, and also possibly release some incarnation of it as an add-on package.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=189&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/04/12/thoughts-on-developing-a-template-strategy-and-my-new-template-click-through-utility/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>
	</item>
		<item>
		<title>Up to my eyeballs in MODx Revolution Permissions</title>
		<link>http://ichosemodx.wordpress.com/2010/04/02/up-to-my-eyeballs-in-modx-revolution-permissions/</link>
		<comments>http://ichosemodx.wordpress.com/2010/04/02/up-to-my-eyeballs-in-modx-revolution-permissions/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 14:20:08 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Using MODx Revolution]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx permissions]]></category>
		<category><![CDATA[modx revolution]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=173</guid>
		<description><![CDATA[The above title is the answer to the question, &#8220;where has the author of this blog been for the past six weeks?&#8221; Like Gandalf battling the Balrog, I&#8217;ve been lurking in the underworld, fighting to the death with MODx Revolution permissions. I am working on a MODx Revolution deployment that will replace the current Dreamweaver/FTP-based [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=173&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The above title is the answer to the question, &#8220;where has the author of this blog been for the past six weeks?&#8221;</p>
<p>Like <a href="http://www.youtube.com/watch?v=44kBN340vd4#t=2m09s" target="_blank">Gandalf  battling the Balrog</a>, I&#8217;ve been lurking in the underworld, fighting to the death  with MODx Revolution permissions.</p>
<p><span id="more-173"></span>I am working on a MODx Revolution deployment that will replace the current Dreamweaver/FTP-based publishing system on the 5000+ page website of a major <a href="http://www.wisconsin.edu" target="_blank">state university system</a>.  There are about three dozen or so people doing content publishing &#8211; some of them are more dangerous than others and need more restrictions on what they are allowed to do.  Numerous different departments, some with hierarchical relationships.  Everyone needs to be able to see-and-link-to everyone else&#8217;s pages, but I have to be sure departments can&#8217;t edit-or-otherwise-bungle each other&#8217;s pages.</p>
<p>Turns out this whole &#8220;figuring out the permissions and user accounts&#8221; item on my project to-do list is going to be a huge project in and of itself.</p>
<p>The good news is, I&#8217;m exceedingly confident that the MODx Revolution permissions model will ultimately handle everything I need to do.</p>
<p>The bad news is, I&#8217;m largely fumbling my way in the dark, boldly going where no one has gone before.  (Or at least where no one has documented before).</p>
<p>I&#8217;m still quite far away from producing my own detailed tutorial &#8211; at this point if I tried, it would be full of inaccuracies, superstitions and general worthless drivel.  But hopefully I&#8217;ll be writing one at some point in the future when I have a better grasp on (a whole lot of) things.</p>
<div id="attachment_175" class="wp-caption alignright" style="width: 330px"><a href="http://ichosemodx.files.wordpress.com/2010/04/pha412-l.jpg"><img class="size-full wp-image-175 " title="pha412.l" src="http://ichosemodx.files.wordpress.com/2010/04/pha412-l.jpg?w=320&#038;h=294" alt="flawed theory" width="320" height="294" /></a><p class="wp-caption-text">That&#39;s me on the right, and someone from the MODx core team on the left.</p></div>
<p>For now, I&#8217;ll say that &#8211; although it is pretty densely packed, and may require multiple re-readings &#8211; Bob Ray&#8217;s <a href="http://bobsguides.com/revolution-permissions.html" target="_blank">article on Revolution Permissions</a> is an absolutely essential first step toward understanding this subject matter.</p>
<p>Go read that. Then read it again.  Then try to write down some of the basic concepts to prove you have them down.</p>
<p>Then read it again.</p>
<p>And if the skies happen to open for you, and you are blessed with a strong and clear grasp of MODx Revolution permissions, then please do the community a favor and write a tutorial!</p>
<p>I&#8217;ll be back with mine once the dust has settled.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=173&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/04/02/up-to-my-eyeballs-in-modx-revolution-permissions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/04/pha412-l.jpg" medium="image">
			<media:title type="html">pha412.l</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple page layouts with a single template: exploring the power of template variables</title>
		<link>http://ichosemodx.wordpress.com/2010/02/21/one-template-multiple-page-layouts-exploring-the-power-of-template-variables/</link>
		<comments>http://ichosemodx.wordpress.com/2010/02/21/one-template-multiple-page-layouts-exploring-the-power-of-template-variables/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 21:40:49 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Using MODx Revolution]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx blog]]></category>
		<category><![CDATA[modx revolution]]></category>
		<category><![CDATA[template variables]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=109</guid>
		<description><![CDATA[&#8230;realize that a guy my size might take a while just to try and figure out what all this is for -Barenaked Ladies, &#8220;Pinch Me&#8220; Pinch me, indeed. Although I had dabbled with MODx Template Variables a little bit, I must confess that until recently I didn&#8217;t really have any grasp whatsoever of their real [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=109&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote>
<p style="text-align:center;">&#8230;realize that a guy my size might take a while just to<br />
try and figure out what all this is for</p>
<p style="text-align:center;">-Barenaked Ladies, &#8220;<a href="http://www.google.com/url?q=http://s0.ilike.com/play%23Barenaked%2BLadies:Pinch%2BMe:12171:s42827113.11227669.663188.0.2.87%252Cstd_e07ee1cc01434010ba12fb9080353566&amp;ei=Q2Z-S9rqAsTdnAecl81s&amp;sa=X&amp;oi=music_play_track&amp;resnum=1&amp;ct=result&amp;cd=2&amp;ved=0CAcQ0wQoADAA&amp;usg=AFQjCNFffr_wIwGxEmb2X1Yu14Q90h2HxQ" target="_blank">Pinch Me</a>&#8220;</p>
</blockquote>
<p style="text-align:left;">Pinch me, indeed.</p>
<p style="text-align:left;">Although I had dabbled with MODx Template Variables a little bit, I must confess that until recently I didn&#8217;t really have any grasp whatsoever of their real usefulness. Chunks and snippets, those I understood.  But for whatever reason I just couldn&#8217;t grasp why a TV would ever be more useful than a chunk or snippet.  In my defense, the <a href="http://svn.modxcms.com/docs/display/revolution/Template+Variables#TemplateVariables-Usage">example</a> provided in the official documentation doesn&#8217;t provide much insight, since the same functionality could be done with a chunk.</p>
<p style="text-align:left;">But then last week a light bulb finally went on for me.  It began, as do many of my mental breakthroughs, out of stubbornness.   I started transferring our new site design into MODx, setting up an initial template, and breaking it up into logical, reusable bits (chunks).  (All of which, incidentally, is ridiculously easy to do).   For the sake of this discussion, I&#8217;ll focus on a few different basic content layouts our site is going to need:</p>
<p style="text-align:left;"><span id="more-109"></span></p>
<p style="text-align:left;">
<ol>
<li><a href="http://ichosemodx.files.wordpress.com/2010/02/75_25.gif"><br />
<img class="alignnone" title="75_25" src="http://ichosemodx.files.wordpress.com/2010/02/75_25.gif?w=326&#038;h=221" alt="content layout with 75% content area, 25% right column" width="326" height="221" /></a></li>
<li><a href="http://ichosemodx.files.wordpress.com/2010/02/25_50_25.gif"><br />
<img title="25_50_25" src="http://ichosemodx.files.wordpress.com/2010/02/25_50_25.gif?w=323&#038;h=222" alt="content layout with 25% left column, 50% content area, 25% right column" width="323" height="222" /></a></li>
<li><a href="http://ichosemodx.files.wordpress.com/2010/02/100.gif"><br />
<img title="100" src="http://ichosemodx.files.wordpress.com/2010/02/100.gif?w=322&#038;h=218" alt="content layout with full-width content" width="322" height="218" /></a></li>
</ol>
<p>My first instinct was to create a template for each of these layout variations.  That would have worked, would have been okay.  But it somehow struck me as wrong; most of the code stays exactly the same in each variation; only a small bit of div structure changes in each layout.  Why not&#8230; use a single template, with a &#8211; wait for it -<strong> template variable</strong> to determine which layout div structure is used?</p>
<p style="text-align:left;">Now that I finally had the concept of a problem that required a template variable, I was sufficiently motivated to figure out how to go about solving it.   I did so simply by relying on the helpfulness of the MODx user community.  A few posts on the MODx forum, a few Twitter questions, and before long I had exactly what I needed.  It might not seem like a huge deal; in fact In some ways, compared to some of the <a href="http://codingpad.maryspad.com/category/modx/" target="_blank">brilliant MODx tutorials</a> available elsewhere on the web, this seems like the type of thing that is <a href="http://www.youtube.com/watch?v=lc4H6goKFB0" target="_blank">hardly worthy of documenting</a>.  But the way I look at it, if I can help even one other person have the &#8220;aha&#8221; moment that I had regarding the power of template variables, then I will have done a good thing.  Therefore, what little knowledge I have, I now pass on to you.</p>
<h3 style="text-align:left;">Step one:  create your template</h3>
<p>Creating a basic MODx template is literally as simple as pasting your skeletal HTML source code into a form field, and then putting in placeholders for the document title and content.  Breaking up some of the HTML into chunks based on functional purpose is an extra step, but actually makes the template even simpler to work with.  Here&#8217;s what mine more-or-less looked like, before creating the TV:</p>
<pre><span style="color:#808080;">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;[[*pagetitle]]&lt;/title&gt;
<span style="color:#888888;">[[$css_block]]
[[$script_block]]
&lt;/head&gt;
&lt;body&gt;
&lt;div id="container" class="container_16"&gt;
[[$header]]</span></span><span style="color:#888888;">
[[$contentDisplay]]
</span><span style="color:#808080;"><span style="color:#888888;">[[$footer]]</span>
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

</span></pre>
<p>Notice how I created chunks for the css, javascript, header, and footer.  I find this to be very readable and  intuitive.  Also, by breaking things up into logical bits like this, you rarely ever have to edit the template itself.  If you need to add a new css file, you edit your css chunk.  Need to change your banner structure? Go straight to the header chunk.  A system like this can help keep multiple developers from stepping on each others&#8217; toes, but can also help a lone web developer work more efficiently.</p>
<p>[[$contentDisplay]] here represents one of the content layouts depicted above.  (This is what we&#8217;ll soon be replacing with a Template Variable!)</p>
<p>Layout #1, for example, has a div structure that looks like this:</p>
<pre><span style="color:#888888;">&lt;div id="content" class="grid_12"&gt;
[[$fullcontent]]
&lt;/div&gt;
 &lt;!-- right column --&gt;
&lt;div id="rightCol" class="grid_4"&gt;
[[rightColumnWidgets]]
&lt;/div&gt;
</span></pre>
<p>The [[$fullcontent]] chunk just serves as a wrapper for the content itself and an &lt;h1&gt; containing the [[*longtitle]] value:</p>
<pre><span style="color:#888888;">&lt;h1&gt;[[*longtitle]]&lt;/h1&gt;
[[*content]]

</span><span style="color:#888888;"> </span></pre>
<p>I thought it important/useful to create this wrapper since the H1 and content always go together &#8211; it is a &#8220;rule&#8221; of our site design, if you will, and it is always helpful to capture logical groupings like that.  Furthermore, since there are going to be other chunks (for the other layouts) that also pull in our content, creating this wrapper chunk makes things easier to maintain.  If we later decide that we want to include another bit of information, such as page author, or publication date, we can simply edit the [[$fullcontent]] chunk and know that the changes will be made in every content layout.</p>
<p>But I digress.</p>
<h3>Step Two: create your &#8220;content layout&#8221; chunks</h3>
<p><span style="color:#808080;"><span style="color:#000000;">I&#8217;ve already shown you one of the content layouts. You might have noticed we are using the <a href="http://960.gs/" target="_blank">960 Grid System</a> CSS framework to achieve the various layouts. It just makes it ridiculously easy, and we all like easy, right?  Anyway, here are the other two layouts. </span><span style="color:#000000;"> </span><br />
</span></p>
<p><span style="color:#808080;"> </span></p>
<pre>
<ul>
<li>(25% left column, 50% center (content) column, 25% right column)
<pre><span style="color:#808080;">&lt;div id="content" class="grid_12"&gt;
&lt;div class="grid_4"&gt;
&lt;!-- left column widgets go here --&gt;
&lt;/div&gt;
&lt;div id="main" class="grid_8 omega"&gt;
[[$fullcontent]]
&lt;/div&gt;
&lt;div&gt;
&lt;div class="grid_4 supplemental"&gt;
&lt;!-- right column widgets go here --&gt;
&lt;/div&gt;</span><span style="color:#ffffff;">
</span></pre>
</li>
<li>(single content column, 100% width)
<pre><span style="color:#808080;">&lt;div id="content" class="grid_16"&gt;
[[$fullcontent]]
&lt;/div&gt;</span></pre>
</li>
</ul>
</pre>
<p>Now we&#8217;ll save these three as chunks.  A few important steps here:</p>
<ol>
<li>Create a new category, called something like &#8216;contentLayouts&#8217;, and assign these chunks  to that category.  When we create the Template Variable, what it will be doing is letting you choose a chunk from amongst all the chunks of a given category.</li>
<li>Give them short names, using alphanumeric characters and underscores.  For these chunks I used 75_25, 25_50_25, and full_width.   (**I&#8217;m not entirely clear what the MODx rules/best practices are here, I just know that for whatever reason it makes me feel really uncomfortable to do otherwise)</li>
<li>Use the Description field to give them meaningful descriptions.  When a use is editing a page, they will choose a page layout based on the descriptions.</li>
</ol>
<p>Here&#8217;s what this looks like in my Elements tab:</p>
<p><a href="http://ichosemodx.files.wordpress.com/2010/02/layout-chunks.gif"><img class="alignnone size-full wp-image-149" title="layout chunks" src="http://ichosemodx.files.wordpress.com/2010/02/layout-chunks.gif?w=190&#038;h=97" alt="image of MODx directory tree display of content layout chunks" width="190" height="97" /></a></p>
<h3>Step Three: create a snippet to select all &#8220;contentLayout&#8221; chunks</h3>
<p>(From this point on, I&#8217;m largely following the formula described in the &#8220;<a href="http://wiki.modxcms.com/index.php/Create_TV-Based_Chunks" target="_blank">Create TV-Based Chunks</a>&#8221; page on the MODx Wiki site.  I&#8217;ve made a few modifications, so I&#8217;ll document exactly what I&#8217;ve done to make this work, but that page is an excellent background reference that will greatly help you understand the overall logic of what is happening here.)</p>
<p>As I mentioned earlier, the Template Variable is going to allow the page editor to choose a content layout from amongst all of the chunks in the &#8220;contentLayouts&#8221; category.  In order to generate that list, we need a snippet, which we&#8217;ll name &#8216;getChunks&#8217;.</p>
<pre><span style="color:#888888;">&lt;?php
/* Get the chunk objects */
$c = $modx-&gt;newQuery('modChunk');
$c-&gt;leftJoin('modCategory','Category');
$c-&gt;where(array('Category.category' =&gt; $category));

$chunkArray = $modx-&gt;getCollection('modChunk',$c);

$chunkNames=array();

/* Put the chunk names into the array */
foreach($chunkArray as $chunk) {
 $chunkNames[] = $chunk-&gt;get('description') .
                 '==' . $chunk-&gt;get('name');
}
/* Format the chunknames as a delimited string for the TV */
$l_chunks = implode("||",$chunkNames);

return $l_chunks;
?&gt;</span></pre>
<p>I&#8217;m using one of the Revolution versions (with a small modification to the output). Consult the Wiki page for the Evolution version.</p>
<p>What&#8217;s happening in this snippet is pretty straight-forward.  First, all of the chunks in a given category (specified in the snippet call) are returned in an array.  Then the array is used to generate a delimited string, which will (with my example chunks) look like this:</p>
<pre><span style="color:#888888;">
</span></pre>
<p><span style="color:#888888;">25% left column, 50% middle content column, 25% right column==25_50_25||75% left content column, 25% right column==75_25||content spans entire 100% width==full_width</span></p>
<p>In other words, for each chunk I&#8217;m sending</p>
<pre><span style="color:#888888;">description==name

</span></pre>
<p>And using &#8216;||&#8217; as the delimiter between each chunk.  This delimited string will in turn be used by the Template Variable to generate a dropdown list in MODx Manager, which will look roughly like this:</p>
<p><a href="http://ichosemodx.files.wordpress.com/2010/02/tv-dropdown1.gif"><img class="alignnone size-full wp-image-152" style="border:1px solid black;" title="tv dropdown" src="http://ichosemodx.files.wordpress.com/2010/02/tv-dropdown1.gif?w=546&#038;h=243" alt="MODx template variable screen capture" width="546" height="243" /></a></p>
<p>&#8230;and will be constructed of HTML like this:</p>
<pre><span style="color:#888888;">&lt;select&gt;
 &lt;option value="75_25"&gt;Content layout w/ content on left (75%), right column (25%)&lt;/option&gt;
 &lt;option value="25_50_25"&gt;25% left column goes w/ content, 50% middle column content main, 25% right column&lt;/option&gt;
 &lt;option value="full_width"&gt;Content spans the entire width of the layout&lt;/option&gt;
&lt;/select&gt;
</span><span style="color:#888888;"> </span></pre>
<p>See how that all works?  No need to thank me for the backstage pass;  it&#8217;s complimentary.</p>
<p>Moving on &#8230;</p>
<h3>Step Four: Create the Template Variable</h3>
<p>We&#8217;re almost there now.</p>
<ul>
<li>Create a new template variable; I&#8217;m calling mine [[*content_layout]].</li>
<li>Give it a caption to help your content editors grasp it&#8217;s meaning; i.e.  &#8220;Choose a layout for your content.&#8221;</li>
<li>Choose &#8220;Listbox (Single-Select) as your Input Type.</li>
</ul>
<p>The &#8220;Input Option Values&#8221; field is the one that wants a delimited string of input options; this, then, is where we will call our snippet.</p>
<p>To call a snippet as the data source for a TV, we need to use the @EVAL <a href="http://svn.modxcms.com/docs/display/revolution/Bindings" target="_blank">binding</a>.  We&#8217;ll be calling our &#8216;getChunks&#8217; snippet, and asking it to return all chunks where category=&#8217;contentLayouts&#8217;.  Here&#8217;s what that looks like in an @EVAL binding statement:</p>
<p><span style="color:#888888;">@EVAL return $modx-&gt;runSnippet(&#8216;getChunks&#8217;,array(&#8216;category&#8217;=&gt;&#8217;contentLayouts&#8217;));</span></p>
<p><span style="color:#888888;"> </span></p>
<pre><span style="color:#888888;">
</span><span style="color:#888888;"> </span></pre>
<p>Just a couple more fields to fill in and the TV will be complete.</p>
<ul>
<li>Default Value:  Enter here the name (not the description) of the content layout that you want to be your default option.  This is important &#8211; since we are relying on the content-layout-chunks to deliver the content, if we don&#8217;t select one, we simply won&#8217;t have any content on the page.</li>
<li>Output Type:  String.   We will simply be outputting the name of the selected chunk into the body of our template. This will make sense after the next/final step.</li>
<li>String Format: None.</li>
</ul>
<p>Before saving the Template Variable, remember to click over to the Template Access tab and allow the appropriate template(s) access to this template variable.  Not much good otherwise&#8230;</p>
<h3>Step Five: Modify the Template to Receive the TV Output</h3>
<p>Now we go back to the original Template, and modify it to give a landing-place to the output from the Template Variable.  If you named your TV &#8216;content_layout&#8217;, you access it with [[*content_layout]].</p>
<div>But remember &#8211; all the TV gives us for output is the <em>name</em> of the chunk that was selected.  What we really want displayed is the chunk itself, in all it&#8217;s chunky glory.  To do that, we need to nest the TV tag inside of a chunk tag:</div>
<p><strong>[[$[[*content_layout]]]]</strong></p>
<p>Just to be clear, here&#8217;s how this will work.  If the user selected the chunk &#8217;75_25&#8242;, the line above will be parsed to:</p>
<p><strong>[[$75_25]]</strong></p>
<p>&#8230; which will then be further parsed to:</p>
<pre><span style="color:#808080;">&lt;div id="content" class="grid_12"&gt;
[[$fullcontent]]
&lt;/div&gt;
 &lt;!-- right column --&gt;
&lt;div id="rightCol" class="grid_16"&gt;
[[rightColumnWidgets]]
&lt;/div&gt;

</span></pre>
<p>&#8230;which will then be parsed yet again to:  &#8230; oh, you get the idea.</p>
<p>The final template, then, will look like this:</p>
<pre><span style="color:#808080;">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;[[*pagetitle]]&lt;/title&gt;
[[$css_block]]
[[$script_block]]
&lt;/head&gt;
&lt;body&gt;
&lt;div id="container"class="container_16"&gt;
[[$header]]
[[$[[*content_layout]]]]
[[$footer]]
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

</span><span style="color:#808080;"> </span></pre>
<h3>And we&#8217;re done!</h3>
<p>We now have a rather nifty, versatile MODx template that lets the resource editor drop the [[*content]] into any number of different inner-div structures, allowing for any number of different content layouts.</p>
<p>Pinch me.</p>
<pre><span style="color:#888888;"> </span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=109&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/02/21/one-template-multiple-page-layouts-exploring-the-power-of-template-variables/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/02/75_25.gif" medium="image">
			<media:title type="html">75_25</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/02/25_50_25.gif" medium="image">
			<media:title type="html">25_50_25</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/02/100.gif" medium="image">
			<media:title type="html">100</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/02/layout-chunks.gif" medium="image">
			<media:title type="html">layout chunks</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/02/tv-dropdown1.gif" medium="image">
			<media:title type="html">tv dropdown</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;I love them equally&#8221; &#8212; a chat about MODx and Drupal with a fan of both systems</title>
		<link>http://ichosemodx.wordpress.com/2010/02/16/i-love-them-equally-a-chat-about-modx-and-drupal-with-a-fan-of-both-systems/</link>
		<comments>http://ichosemodx.wordpress.com/2010/02/16/i-love-them-equally-a-chat-about-modx-and-drupal-with-a-fan-of-both-systems/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 14:32:33 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[CMS selection]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx blog]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=59</guid>
		<description><![CDATA[MODx and Drupal&#8230;  Living together?  What madness is this?  Things fall apart; the centre cannot hold&#8230;  and all that stuff. Today marks a new &#8216;first&#8217; for this blog &#8211; an informed, thoughtful take on the Drupal vs. MODx debate based on actual experience with each system. Needless to say, such a rational, measured (not to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=59&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>MODx <em>and</em> Drupal&#8230;  Living together?  What madness is this?  Things fall apart; the centre cannot hold&#8230;  and all that stuff.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='570' height='351' src='http://www.youtube.com/embed/O3ZOKDmorj0?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span>
<p>Today marks a new &#8216;first&#8217; for this blog &#8211; an informed, thoughtful take on the Drupal vs. MODx debate based on actual <em>experience</em> with each system.</p>
<p><span id="more-59"></span></p>
<p>Needless to say, such a rational, measured (not to mention effort-based) approach is well beyond my personal capabilities.  So I&#8217;ve brought in some outside help.</p>
<p>Mary L. from <a href="http://codingpad.maryspad.com/" target="_blank">The Coding Pad</a> has written some excellent MODx <a href="http://codingpad.maryspad.com/category/modx/">tutorials</a>, and has recently posted two very informative interviews with members of the MODx <a href="http://codingpad.maryspad.com/2010/01/19/interview-jason-coward-modx/">core</a> <a href="http://codingpad.maryspad.com/2010/01/05/interview-with-shaun-mccormick-mod/">team</a>.</p>
<p>She also uses, <a href="http://codingpad.maryspad.com/category/drupal/">writes about</a>, and (this is important) <em>*likes* </em>Drupal.</p>
<p>Mary appeared on my MODx radar screen recently over on Twitter, where she writes as <a href="http://twitter.com/einsteinsboi">@einsteinsboi</a>, when she tweeted the following in an exchange with another user:</p>
<blockquote>
<div style="padding-left:30px;">
<p>I love both MODx and Drupal equally. Each has its strengths and weaknesses, and I say it really depends on what you&#8217;re building.</p>
</div>
</blockquote>
<p>Needless to say, this messed with my narrow-minded world-view.  I had to know more.  I contacted Mary, and, even though I have no credentials beyond being a freak with his own MODx blog, she graciously agreed to answer some questions on the MODx vs. Drupal debate.  I learned a lot from this exchange, and I think the results will be a good read for anyone trying to make an informed CMS decision.</p>
<p><strong>What is your background/history in web programming?</strong> <strong>I get the impression that its never been your primary career, but it sure seems like you&#8217;ve immersed yourself in it.</strong></p>
<p>Well, you&#8217;re right about that. I don&#8217;t have a formal education in programming and web development and it&#8217;s never been my primary career.  It&#8217;s been a hobby for the most part, but recently it&#8217;s evolving more into a freelancing business and it&#8217;s the way I want to it to progress, and perhaps eventually into a fulltime career.  Even though my professional training and career is currently in healthcare, I have a graduate degree in Physics and taught at college (undergrad and grad level) for several years as well as doing Physics related research which involved a lot of time in front of a computer doing data modeling,  simulations, interfacing, and computations. My work at different times involved programming in Fortran, the old MS BASIC, Visual Basic, LabView, Matlab, MathCAD, etc.  I don&#8217;t do that as much anymore but it gave me an appreciation and love for all things computing and programming.  I start getting more into web dev as an outlet for that part of my brain and I&#8217;ve enjoyed it immensely.  I have an infinite curiosity and a healthy amount of ADD so this kind of work keeps my brain occupied and happy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div><strong><br />
What is your background/history with web CMS?</strong></div>
<div><strong><br />
</strong></div>
<p>Well, I started out with plain HTML in the days of geocities, and then moved on to CMSs.  I started out with b2evolution which is what my personal blog was initially built on. I eventually migrated that to WordPress.  Then I discovered Drupal and SMF forums and my love affair with CMSs truly began.  After dabbling with Drupal for a while I started playing with flat file CMSs because the free host I was using at the time only allowed you five MySQL databases, and I had exhausted mine. I tried quite a few but especially nano cms (which seems to have vanished), razor cms which I think is still actively developed, and flatpress.  I also dabbled with Joomla for while, but that didn&#8217;t last very long.  But the two that I consistently worked with through this time were WordPress and Drupal, and SMF for forums. I then discovered MODx about a year ago and have been learning and working with it and loving it. Initially when I started exploring it was definitely just out of curiousity, and as a hobby, then I thought it would be cool to have a website, then a blog, then I started thinking of problems to solve, or being approached to solve problems, and it all evolved from there. I have a couple more CMSs on my radar to learn and work with but WordPress,Drupal, and MODx are the primary ones that I&#8217;m involved with and actively use at the moment. I&#8217;m not by any means an expert in any of them but I learn more and more with each project and task I undertake, and as I teach and share what I know.</p>
<div><strong><br />
You wrote this on Twitter:  <em>I love both MODx and Drupal equally. Each has its strengths and weaknesses, and I say it really depends on what you&#8217;re building. </em>That caught my attention, and I was wondering if you could elaborate on it. What are the strengths/weaknesses of each in your opinion, and what would be an example of a project better suited for Drupal vs. one better suited for MODx?</strong></div>
<div><strong><br />
</strong></div>
<div id="attachment_101" class="wp-caption alignright" style="width: 310px"><a href="http://ichosemodx.files.wordpress.com/2010/02/einsteinsboi.jpg"><img class="size-medium wp-image-101 " title="einsteinsboi" src="http://ichosemodx.files.wordpress.com/2010/02/einsteinsboi.jpg?w=300&#038;h=199" alt="Mary L. (@einsteinboi)" width="300" height="199" /></a><p class="wp-caption-text">Mary L. writes about MODx and Drupal at The Coding Pad</p></div>
<p>Well, this is a question I get asked a lot.  I&#8217;m a strong advocate for using the right tool for the job (if you&#8217;re interested on my thoughts on this, you can read <a href="http://codingpad.maryspad.com/2009/12/05/the-right-cms/" target="_blank">http://codingpad.maryspad.com/2009/12/05/the-right-cms/</a>).  The phrase &#8220;right tool&#8221; is very subjective, because we all have different tools in our arsenal.  Let me give you an example. If a client asked me to build a website with a strong community component, including intricate user functionality, lots of permission structure stuff, commenting, multiblogs, forums, reviews and ratings, lots of community widgets, etc., I would dive for Drupal first, simply because there are already lots of ready made modules and my work would simply be to string everything together, configure, set up, and press go (it sounds simpler when written out like that <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).  I would be reluctant to launch into this with MODx because it would involve a lot of custom coding to create all the different components and make them work together.  I think that when I master Revo this might not be the case, but with Evolution I think it would definitely be so. I&#8217;m not saying it can&#8217;t be done, but I&#8217;m not sure I would be able to justify the work involved when I have Drupal available. If a client simply wanted a blog I would dig for WordPress, because that&#8217;s what WordPress excels at.  For anything else, I would reach for MODx.  It&#8217;s all a matter of functionality, time investment, budget constraints, etc.  Again, this reflects my own personal opinion, preferences, and current skillset.  For someone else it&#8217;s bound to be different.  I appreciate the strengths that all these CMSs bring to the table, particularly MODx and Drupal, and feel that I would be cheating myself and my clients if I didn&#8217;t exploit these to the best of my ability.</p>
<div>
<p><strong>One of the reasons I chose MODx over Drupal was that I found the infamous &#8220;Drupal learning curve&#8221; rather intimidating and not a good fit for my timeframe and needs. I&#8217;ve found MODx mostly intuitive so far, and been able to do some pretty elaborate prototyping in a short amount of time.  But I&#8217;m realizing that there is still a pretty large learning curve with MODx.  How do you compare the learning curves, and do you think that Drupal&#8217;s learning curve deserves the reputation it has?</strong></p>
<p><strong> </strong></p>
</div>
<p>I don&#8217;t think Drupal entirely deserves the reputation of having a steep learning curve. Getting the initial concepts, as with everything else, may be challenging to someone not used to dealing with CMSs, but once you get over that initial bump I think it&#8217;s not that bad. Besides, there is a LOT of beginner friendly information out there, tutorials, screencasts, etc.  As far as custom coding modules and themes, this may be a little different. I have never tried to intentionally master creating my own modules or themes, so I may not be the most suitable candidate to answer this question. But in terms of just building a Drupal website with what&#8217;s already freely and readily available, I disagree to some extent with the steep learning curve reputation.  Again, it might depend on what your background is, what your timeline is, and what your expectations are.  The best way to learn Drupal is to take your time with it.  Learning Drupal when you have a project with a deadline is not necessarily the most optimal approach, and I think this is in part where the steep learning curve reputation comes from.  I believe this is the best read on the topic -&gt; <a href="http://learnbythedrop.com/drop/155" target="_blank">http://learnbythedrop.com/drop/155</a></p>
<p>I think MODx is intuitive in a lot of ways because of the framework and flexibility aspects of it. In some ways I think of MODx as being more &#8220;naked&#8221;, for lack of a better word, than most CMSs out there.  This allows a PHP programmer to start working with MODx and &#8220;get it&#8221; quickly as opposed to Drupal where you have to almost learn a whole new language and way of doing things and deal with modules that aren&#8217;t as easy to customize assnippet might be. And let&#8217;s not even talk about the theming issues and how much easier it is to template MODx than it is to theme Drupal <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>That said, depending on your background, it can be easier to learn Drupal than it is to learn MODx. When I started learning Drupal, I hardly knew any PHP, so the module-based structure of Drupal worked well for me at the time and was easy to learn. I didn&#8217;t need to know any PHP or anything to get a pretty functional and even complex site up and running, just using what was freely available.  Then, because I needed to do more, I started looking at the insides, the code, playing with the API, trying to create my own small modules.  Because I had an appreciation for how Drupal itself worked, I could now start focusing on the more complicated stuff. I also started tearing themes apart and looking at them, trying to figure them out, customize them, and replicate them. When I found MODx, I was already more comfortable with PHP from playing with Drupal and customizing WordPress, so then learning MODx was pretty easy for me. I guess what I&#8217;m saying is that the learning curve really depends on where you&#8217;re coming from.  Drupal has a lot of documentation and user created resources out there that allow for complete rank beginners in anything to start figuring things out and learning without the barrier of not knowing PHP or programming getting in their way.  On  the other hand, a lot of the documentation out there for MODx is more aimed at developers and people with some programming experience, and therefore that makes it easy for some developers to make sense of MODx more easily than they would of Drupal.</p>
<div>
<p><strong>How about the user communities?  Both Drupal and MODx seem to have a strong reputation for their user communities; what has been your experience with each?</strong></p>
<p>I&#8217;m a relatively active member of both communities and I find them both to be active, friendly, and engaged. The Drupal community is a lot bigger and has been around for a long time compared to the MODx community, so ofcourse there&#8217;s a different approach to newbie questions in the Drupal forum than there is on the MODx forum which is younger and more newbie friendly.  That said, I do find the Drupal community to be welcoming of beginners and willing to engage and help them. However, because a lot of the newbie questions have been asked and answered over and over again, you&#8217;re more likely to get &#8220;search the forum&#8221; &#8220;this has been discussed before&#8221; kind of answers or no response at all than you would on the MODx forums, which might sound hostile and unwelcoming to some.  I find that any community, given time, does develop an air of exclusivity about it and you just have to know how to approach it, do your homework and ask intelligently phrased questions that show how what you&#8217;ve done, attempted, and where you&#8217;re stuck.  I think this is the natural evolution of programming/tech communities as their products mature and become more well documented.  Developers are prone to move on to solving more complex problems and don&#8217;t have the patience or time to help solve what they think are rudimentary or obvious problems.  This is just my observation.  Some might disagree with me. In all communities there will always be the die-hard fans who won&#8217;t tolerate discussing any other solution but in my opinion and experience these are the exception rather than the norm in both communities.</p>
</div>
<p>All things considered, the MODx community is one of the friendliest, most knowledgeable, and most helpful communities I have ever been part of, and I really feel honored to be counted in their ranks.</p>
<div>
<p><strong>I have two web professionals in my organization who are avid Drupal devotees, and who were rather disappointed that I chose MODx over Drupal for our CMS conversion.  My response was to assure/convince them that 1) Learning MODx would be a cakewalk compared to the effort they have put in to learning Drupal, and 2) Some large percentage of the &#8220;Drupal knowledge&#8221; they have accumulated is actually core &#8220;CMS 101&#8243; knowledge that will directly and intuitively translate in the MODx environment.  These seemed like good arguments to make, but having never actually used Drupal myself, I was pretty much pulling these claims out of my ass.  How do you think I did? </strong></p>
<p><strong><br />
</strong></p>
</div>
<p>Not being an expert in either system, this is a little difficult for me to meaningfully address, but I&#8217;ll try.  Let me just say that you may be underestimating Drupal in your CMS 101 statement <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . When you learn to work with Drupal you learn a paradigm, a way of stringing things together, managing users, managing permissions, creating content types and creating views to present your data as you want it to appear, and so so much more.  Not all these things are common to all CMSs. It may depend on how deeply they&#8217;ve developed for Drupal, how much they know, what their skillset is. I don&#8217;t know that the knowledge gained developing for Drupal will directly and intuitively translate in the MODx environment. There is no easy plug-and-play functionality in MODx Evolution as yet.  Apart from the initially installed snippets, installing any other snippets involves some copy-pasting, and sometimes tedious and easy to mess up steps.  Ofcourse this is all changing with Revo and package management (yay!!).  Also, snippet calls, cached and uncached status, etc, are concepts that I&#8217;ve found people struggle with sometimes when setting up snippets, whereas Drupal modules tend to be pretty straightforward to install and configure once you get the basic concepts.</p>
<p>I would say plain PHP knowledge intuitively and directly translates to MODx.  Both Drupal and MODx have their own APIs, so there&#8217;s not a direct translation per se, but there is a translation in the understanding of content management systems and their underlying principles.  Again, depending on your web professionals&#8217; knowledge and skill level, they may be completely flummoxed by MODx or find it easy as pie.</p>
<p>I think generalizations can be a little misleading, since one is not easier to learn than the other at baseline, it all depends on where you&#8217;re coming from. If I had met MODx before I met Drupal I would probably have run away screaming. But because Drupal (and WordPress) had given me the foundation I needed and the confidence to build relatively complex websites without knowing a lick of PHP, I was able to start exploring and eventually learn to program PHP, and understand the basic concepts behind content management systems and the separation between content management and layout.</p>
<p>I don&#8217;t think there is really anything to unlearn, just new knowledge to gain, a different way of doing things, and a new API.  I can tell you from experience that having been accustomed to the Drupal user management and permissions system, the MODx one simply doesn&#8217;t work for me yet, and I find it confusing and limiting at best (I&#8217;m talking about Evolution, I haven&#8217;t delved into that aspect of Revolution yet).  But this is a reflection on my own knowledge and skill level, and not of the MODx user management system itself. Different strokes for different folks and all that <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   These are issues that I think you may find reflected in the experience of your web professionals as they migrate to MODx&#8230; or not <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div>
<p><strong>One thing that turned me off to Drupal was this certain vibe or scent it gave off, that to choose Drupal was to make a major, all-encompassing, &#8220;way-of-life&#8221; type choice&#8230; that once you went down the Drupal road there was no turning back&#8230; I&#8217;d be locked in to &#8220;thinking in Drupal&#8221;, writing Drupal themes, Drupal modules&#8230; that I&#8217;d become a &#8220;Drupal person&#8221;, and henceforth every decision about any aspect of our website would have to be viewed through the all-powerful Drupal lens.  Working with MODx doesn&#8217;t feel that way to me&#8230; it feels more like I am just using a very handy tool to organize, streamline and add value to my web development efforts. I don&#8217;t feel like I&#8217;m writing anything &#8220;in MODx&#8221;, but rather that I&#8217;m organizing my PHP code, markup, css, javascript and content in a really slick way by using MODx.   So finally the question: How much am I overblowing the distinction between the &#8220;inherent natures&#8221; of Drupal and MODx?</strong></p>
<p><strong> </strong></p>
</div>
<p>Well, your answer is in your question.  Working with MODx fits your style and preferences and works for you.  My answer to this is pretty much covered in one of my earlier answers where I talked about the distinctions between MODx and Drupal.  While both can be considered frameworks in their own right, MODx allows you a lot more flexibility when working with PHP and with HTML/CSS in terms, and when integrating your own custom scripts or other third-party scripts.</p>
<p>I think that your statement about a &#8220;way-of-life&#8221; type choice can be applied to any tool, and will probably become the same of MODx as it matures and becomes more popular and more mainstream and develops an ardent fan base, which it already has.  But this is a personal thing and having this perspective is a personal choice. I know quite a few developers like myself who use Drupal and develop in Drupal, but also use other CMSs and tools as and when needed. As a friend of mine put it, Drupal puts food on my table, but MODx gives me wings.  Depends on your motivation. Right now I get a lot of clients asking me for WordPress sites, so I&#8217;m spending a lot of time with WordPress.  Most clients won&#8217;t even look twice at MODx because they don&#8217;t know what it is. I try to sway them as much as I can when I think MODx or Drupal are a better choice, but people will go with what they&#8217;re familiar with and think they can maintain.  Same thing, bigger companies will ask for Drupal sites because they&#8217;ve heard the Drupal buzz and know they can easily find Drupal developers if they need them in the future.  Additionally, for a lot of people, once they immerse themselves in and learn one tool, it&#8217;s not worth it knowing more than this favorite tool, so they make it a way-of-life. It&#8217;s all very subjective.</p>
<div><strong><br />
Lastly, how would you make the case for MODx to a fundamentalist Drupal-head?  And how would you make the case to someone like me &#8212; with a clear skepticism about Drupal that is likely at least somewhat unmerited &#8212; that I might want to consider Drupal in the future if the right circumstances come along?</strong></div>
<div><strong><br />
</strong></div>
<p>I don&#8217;t know if I would try <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   People can be very set in their ways and opinions, and I respect that. But here are my thoughts if I were to try. If we were working on a project collaboratively and needed to pick a tool, then I would use examples, prototypes, and pretty much the arguments I covered in earlier answers regarding the ease of use versus flexibility of each tool. If either tool would work just fine, then it would depend on skill level, time constraints, and budget issues.</p>
<p>Just because you can build anything with MODx doesn&#8217;t mean you should. Pick the right tool for the job.  MODx is flexible, easy to customize and extend <strong>with the right skillset</strong>, easy to template, and more aligned with current OOP practices.  Drupal is powerful, has been around for a long time, has tons of documentations and user resources, has tons of modules and extensions already available, and has proven to be stable through several iterations.  It&#8217;s actively developed and has proved it&#8217;s not going anywhere.</p>
<p>To over-simplify this answer, if you need a powerful scaleable solution AND need lots of hand holding, ready-made components, and  documentation OR you just don’t have the time or budget to custom code the things you need, go for Drupal, there’s always a module for what you need. If,  however, you need a powerful scaleable solution AND want lots of flexibility, and have the skills, the time, and the budget to custom code stuff and to learn, go with MODx. This is an over-simplification, and it may not necessarily be 100% accurate, but  it’s how I perceive it.  MODx in and of itself is a powerhouse that  hasn&#8217;t received the exposure it deserves, and I feel like I haven&#8217;t even  begun to tap into all it&#8217;s possibilities.  Additionally, I&#8217;ve been  using Drupal a lot longer than I have used MODx, and I know I still have  a lot of learning to do, and so my thoughts here should be read and  understood in that light.</p>
<p>I think when Revo comes along and user and newbie-friendly and end-user documentation becomes more available MODx will be a force to contend with across the spectrum, but right now you may find yourself banging your head against the wall especially with non-developers who would rather use plug-and-play systems that already have the functionality they need in easy to install and configure modules and plugins, with lots of documentation and tutorials a la WordPress and Drupal.  And I say this from the position of being an ardent MODx fan <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Thank you Mary for taking the time to answer these questions in such an insightful manner. I think it will generate some great discussion, as well as serve as a good guide for those trying to make an initial CMS decision.</strong></p>
<p><strong><a href="http://polldaddy.com/poll/2708346/">View This Poll</a><br />
</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=59&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/02/16/i-love-them-equally-a-chat-about-modx-and-drupal-with-a-fan-of-both-systems/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>

		<media:content url="http://ichosemodx.files.wordpress.com/2010/02/einsteinsboi.jpg?w=300" medium="image">
			<media:title type="html">einsteinsboi</media:title>
		</media:content>
	</item>
		<item>
		<title>Top Ten Big Things I hope to do in MODx</title>
		<link>http://ichosemodx.wordpress.com/2010/02/09/top-ten-big-things-i-hope-to-do-in-modx/</link>
		<comments>http://ichosemodx.wordpress.com/2010/02/09/top-ten-big-things-i-hope-to-do-in-modx/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 19:47:48 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[CMS selection]]></category>
		<category><![CDATA[Using MODx Revolution]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[modx revolution]]></category>

		<guid isPermaLink="false">http://ichosemodx.wordpress.com/?p=44</guid>
		<description><![CDATA[(Who am I kidding, I can&#8217;t count to 10&#8230;) These are not in any particular order, and I can almost guarantee there won&#8217;t be 10 things&#8230; that just sounded better than &#8220;Top Several Things&#8221;.  These are just some of the &#8220;to-do&#8217;s&#8221; and &#8220;would-be-nice&#8217;s&#8221; that I&#8217;ve identified so far as I&#8217;ve mapped out my project plan [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=44&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>(Who am I kidding, I can&#8217;t count to 10&#8230;)</p>
<p>These are not in any particular order, and I can almost guarantee there won&#8217;t be 10 things&#8230; that just sounded better than &#8220;Top Several Things&#8221;.  These are just some of the &#8220;to-do&#8217;s&#8221; and &#8220;would-be-nice&#8217;s&#8221; that I&#8217;ve identified so far as I&#8217;ve mapped out my project plan for the next few months.  Some of them are probably slam-dunks, and others are probably criminally insane.  Any feedback (insight, encouragement, discouragement, whatever) would be greatly appreciated.</p>
<p><span id="more-44"></span></p>
<ol>
<li><strong>Integrate &#8220;Manage Users&#8221; with our company LDAP information. </strong> So I can add users by selecting them from a list of all existing employees.  Because I hate typing in employee information that already exists somewhere else on the network.<br />
(I am fully aware that this will probably take longer for me to figure out than it would to just key in the employee info for the 2-3 dozen people who need accounts&#8230; and I&#8217;m still hell-bent on doing it).</li>
<li><strong>Integrate Manager authentication into our intranet site.</strong> In my MODx dreamworld, my users will log in to the company intranet, and, if they are MODx users, will be simultaneously logged in to Manager, with some sort of smart link on the screen to make them aware and take them there. (I&#8217;m in various stages of doing the same thing with our web/calendar, our web file storage server, and our helpdesk call tracking system. It just seems like the thing to [attempt to] do).</li>
<li><strong>Identify the most logically sound template strategy I possibly can.</strong> By which I mean, gain a better understanding of when/how to best use Template Variables (among other things, some of which I&#8217;m probably not even aware of yet) to allow the use of one or two primary templates across our entire site.   Our design scheme isn&#8217;t too complicated &#8211; I&#8217;m going to need to customize some background images, probably based on &#8220;department&#8221; and &#8220;parent department&#8221; affiliation of the pages.  First I have to figure out the &#8220;business logic&#8221; (which parts of the design are fixed globally, which parts are fixed based on belonging to a department, and which parts can be overridden at a per-page level).  Then I need to understand TVs &amp; etc.  well enough to transpose those rules into some sexy &amp; ruthlessly efficient template logic.</li>
<li><strong>Rock some custom page-specific jQuery</strong>.  This is the one I&#8217;m most excited about at the moment.  Because jQuery <a href="http://www.catswhocode.com/blog/8-awesome-jquery-tips-and-tricks" target="_blank">makes life worth living</a>, I want to be able to allow some (read: a carefully vetted elite group of users who WON&#8217;T BREAK THE INTERNET) of my MODx editors/page-wranglers to use it on their pages.   I think I have a sound plan mapped out involving the use of TVs and chunks to create an à la carte library of handy pieces of jQuery.  Hopefully I&#8217;ll flesh this out and do a full-length post on it someday soon.</li>
<li><strong>Implement a revisioning system, or at least a solid backup/recovery plan</strong>.  This is CYA territory, plain and simple.  In our current Dreamweaver/FTP-based publishing paradigm, when someone blows away or hopelessly bungles a file or directory, we at least have the option to restore it from tape backups.  I don&#8217;t necessarily need something more finely-tuned than that, but I do need to offer at least the equivalent of that.  I&#8217;ve been avoiding dealing with this issue, but it isn&#8217;t going away on its own.</li>
</ol>
<p>&#8230;and with that, I&#8217;m out of gas for today.  Too lazy to re-edit the title, I&#8217;ll just leave this as a list of five things.  Perhaps with more to come.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ichosemodx.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ichosemodx.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ichosemodx.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ichosemodx.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ichosemodx.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ichosemodx.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ichosemodx.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ichosemodx.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ichosemodx.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ichosemodx.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ichosemodx.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ichosemodx.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ichosemodx.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ichosemodx.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ichosemodx.wordpress.com&amp;blog=11831636&amp;post=44&amp;subd=ichosemodx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ichosemodx.wordpress.com/2010/02/09/top-ten-big-things-i-hope-to-do-in-modx/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49b94ce16b5f97d828ef48867211c0ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">james</media:title>
		</media:content>
	</item>
	</channel>
</rss>
