<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: MODx Snippet: ChunkIf</title>
	<atom:link href="http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 02 May 2010 02:24:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Duncan Lock</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-615</link>
		<dc:creator>Duncan Lock</dc:creator>
		<pubDate>Tue, 03 Nov 2009 12:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-615</guid>
		<description>As in, you have a drop-down menu on the form and choosing different entries from the drop-down menu, causes different chunks to be displayed?
Unless you&#039;re going to submit the form, or do something clever with &lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_(programming)&quot; rel=&quot;nofollow&quot;&gt;AJAX&lt;/a&gt;, no.
This snippet - like all MODx snippets - is evaluated by the MODx Document Parser on the server, as the page is being built, before it&#039;s sent back to the browser. Once the web page has been sent to the browser, it&#039;s out of MODx&#039;s hands, until another request is made to the server - i.e. a page refresh, new page request or a form submission.
If you want to do things on the page after it&#039;s been sent to the browser - without a page refresh - then you need javascript. Javascript - unlike PHP - is a client-side language and runs in the browser, so you can use it to do dynamic things on the page after it&#039;s been sent to the browser. You could certainly show and hide bits of a form, based on selections in a drop-down, using javascript, if that&#039;s what you wanted to do.</description>
		<content:encoded><![CDATA[<p>As in, you have a drop-down menu on the form and choosing different entries from the drop-down menu, causes different chunks to be displayed?<br />
Unless you&#8217;re going to submit the form, or do something clever with <a href="http://en.wikipedia.org/wiki/Ajax_(programming)" rel="nofollow">AJAX</a>, no.<br />
This snippet &#8211; like all MODx snippets &#8211; is evaluated by the MODx Document Parser on the server, as the page is being built, before it&#8217;s sent back to the browser. Once the web page has been sent to the browser, it&#8217;s out of MODx&#8217;s hands, until another request is made to the server &#8211; i.e. a page refresh, new page request or a form submission.<br />
If you want to do things on the page after it&#8217;s been sent to the browser &#8211; without a page refresh &#8211; then you need javascript. Javascript &#8211; unlike PHP &#8211; is a client-side language and runs in the browser, so you can use it to do dynamic things on the page after it&#8217;s been sent to the browser. You could certainly show and hide bits of a form, based on selections in a drop-down, using javascript, if that&#8217;s what you wanted to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lsd</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-614</link>
		<dc:creator>lsd</dc:creator>
		<pubDate>Tue, 03 Nov 2009 05:15:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-614</guid>
		<description>Is it possible to use this snippet in eForm tpl with select option to get chunk?

Thanks</description>
		<content:encoded><![CDATA[<p>Is it possible to use this snippet in eForm tpl with select option to get chunk?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duncan Lock</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-613</link>
		<dc:creator>Duncan Lock</dc:creator>
		<pubDate>Wed, 21 Oct 2009 20:31:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-613</guid>
		<description>You might like to read through this MODx wiki article which covers this in detail:

&lt;a href=&quot;http://wiki.modxcms.com/index.php/Snippet_call_anatomy&quot; rel=&quot;nofollow&quot;&gt;http://wiki.modxcms.com/index.php/Snippet_call_anatomy&lt;/a&gt;

If this doesn&#039;t answer your question fully, then you might like to try running your site completely un-cached. I sometimes do this for smaller sites with less traffic. The affect on visitors is minimal or non-existent, it smooths out the editing experience for editors and eliminates issues like this. You can change the cache status of all pages on your site via the DocManager module, and set the default in the Configuration tab.</description>
		<content:encoded><![CDATA[<p>You might like to read through this MODx wiki article which covers this in detail:</p>
<p><a href="http://wiki.modxcms.com/index.php/Snippet_call_anatomy" rel="nofollow">http://wiki.modxcms.com/index.php/Snippet_call_anatomy</a></p>
<p>If this doesn&#8217;t answer your question fully, then you might like to try running your site completely un-cached. I sometimes do this for smaller sites with less traffic. The affect on visitors is minimal or non-existent, it smooths out the editing experience for editors and eliminates issues like this. You can change the cache status of all pages on your site via the DocManager module, and set the default in the Configuration tab.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lester</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-612</link>
		<dc:creator>Lester</dc:creator>
		<pubDate>Sun, 18 Oct 2009 03:44:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-612</guid>
		<description>Hi, thanks for this simple but useful snippet.
Related with that I have a question. What about if one of the chunks must contains an snippet call? I did try it an uncached ([!snippetName!]) call but MODx output the snippet call literally, without parsing it. The only way is calling the snippet in cached way ([[snippetName]]), but that isn&#039;t fine for all kind of snippets. Do you have a solution for that?

Regards, 
Lester</description>
		<content:encoded><![CDATA[<p>Hi, thanks for this simple but useful snippet.<br />
Related with that I have a question. What about if one of the chunks must contains an snippet call? I did try it an uncached ([!snippetName!]) call but MODx output the snippet call literally, without parsing it. The only way is calling the snippet in cached way ([[snippetName]]), but that isn&#8217;t fine for all kind of snippets. Do you have a solution for that?</p>
<p>Regards,<br />
Lester</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raf sixty-huit</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-408</link>
		<dc:creator>Raf sixty-huit</dc:creator>
		<pubDate>Tue, 11 Aug 2009 09:32:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-408</guid>
		<description>Thanks for that snippet.

It works at first try ;)</description>
		<content:encoded><![CDATA[<p>Thanks for that snippet.</p>
<p>It works at first try <img src='http://www.codeistry.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duncan Lock</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-246</link>
		<dc:creator>Duncan Lock</dc:creator>
		<pubDate>Tue, 28 Jul 2009 18:34:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-246</guid>
		<description>Thanks for pointing that out Jorgen, it got mangled by the syntax highlighter, I think. I&#039;ve fixed it and changed the highlighter that I&#039;m using.

Cheers,
Dunc</description>
		<content:encoded><![CDATA[<p>Thanks for pointing that out Jorgen, it got mangled by the syntax highlighter, I think. I&#8217;ve fixed it and changed the highlighter that I&#8217;m using.</p>
<p>Cheers,<br />
Dunc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorgen</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-245</link>
		<dc:creator>Jorgen</dc:creator>
		<pubDate>Tue, 21 Jul 2009 08:44:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-245</guid>
		<description>Nevermind. I found that your code in the box above is rendered in HTML entities. So the -&gt; is replaced with the HTML code. Which of course doesn&#039;t get parsed very well.</description>
		<content:encoded><![CDATA[<p>Nevermind. I found that your code in the box above is rendered in HTML entities. So the -&gt; is replaced with the HTML code. Which of course doesn&#8217;t get parsed very well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorgen</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-244</link>
		<dc:creator>Jorgen</dc:creator>
		<pubDate>Tue, 21 Jul 2009 08:23:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-244</guid>
		<description>Hi,

Seems like a very usefull snippet, but can&#039;t seem to get it going. I get an error on line 27, unexpected T_VARIABLE, which means de variable TV doesn&#039;t exist?
Hope you can help me out.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Seems like a very usefull snippet, but can&#8217;t seem to get it going. I get an error on line 27, unexpected T_VARIABLE, which means de variable TV doesn&#8217;t exist?<br />
Hope you can help me out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-183</link>
		<dc:creator>A</dc:creator>
		<pubDate>Mon, 30 Mar 2009 16:37:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-183</guid>
		<description>Thanks, this snippet is very helpful for me.  I was trying to do something similar but couldn&#039;t quite figure it out.</description>
		<content:encoded><![CDATA[<p>Thanks, this snippet is very helpful for me.  I was trying to do something similar but couldn&#8217;t quite figure it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: New years resolutions for 2009 &#171; Codeistry blog</title>
		<link>http://www.codeistry.com/blog/2008/11/modx-snippet-chunkif/comment-page-1/#comment-3</link>
		<dc:creator>New years resolutions for 2009 &#171; Codeistry blog</dc:creator>
		<pubDate>Tue, 06 Jan 2009 15:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.codeistry.com/blog/?p=65#comment-3</guid>
		<description>[...] in the community and that we can all help improve. I&#8217;ve started this process already with the ChunkIf snippet (below) - but there&#8217;s lots more where that came [...]</description>
		<content:encoded><![CDATA[<p>[...] in the community and that we can all help improve. I&#8217;ve started this process already with the ChunkIf snippet (below) &#8211; but there&#8217;s lots more where that came [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
