<style type="text/css">
div#sed_help pre {padding: 0.5em 1em; background: #eee; border: 1px dashed #ccc;}
div#sed_help h1, div#sed_help h2, div#sed_help h3, div#sed_help h3 code {font-family: sans-serif; font-weight: bold;}
div#sed_help h1, div#sed_help h2, div#sed_help h3 {margin-left: -1em;}
div#sed_help h2, div#sed_help h3 {margin-top: 2em;}
div#sed_help h1 {font-size: 2.4em;}
div#sed_help h2 {font-size: 1.8em;}
div#sed_help h3 {font-size: 1.4em;}
div#sed_help h4 {font-size: 1.2em;}
div#sed_help h5 {font-size: 1em;margin-left:1em;font-style:oblique;}
div#sed_help h6 {font-size: 1em;margin-left:2em;font-style:oblique;}
div#sed_help li {list-style-type: disc;}
div#sed_help li li {list-style-type: circle;}
div#sed_help li li li {list-style-type: square;}
div#sed_help li a code {font-weight: normal;}
div#sed_help li code:first-child {background: #ddd;padding:0 .3em;margin-left:-.3em;}
div#sed_help li li code:first-child {background:none;padding:0;margin-left:0;}
div#sed_help dfn {font-weight:bold;font-style:oblique;}
div#sed_help .required, div#sed_help .warning {color:red;}
div#sed_help .default {color:green;}
</style>
 <div id="sed_help">

	<h1>soo_if_frontpage</h1>

 <div id="toc">

	<h2>Contents</h2>

	<ul>
		<li><a href="#overview">Overview</a></li>
		<li><a href="#usage">Usage</a></li>
		<li><a href="#attributes">Attributes</a></li>
		<li><a href="#examples">Examples</a>
	<ul>
		<li><a href="#most">Most restrictive case</a></li>
		<li><a href="#least">Least restrictive case</a></li>
	</ul></li>
		<li><a href="#history">History</a></li>
	</ul>

 </div>

	<h2 id="overview">Overview</h2>

	<p>Similar to the <code>glx_if_frontpage</code> tag from the no-longer-supported <a href="http://www.markupartist.com/files/glx_if.txt"><code>glx_if</code> plugin</a>. Most of <code>glx_if</code>&#8217;s functionality is now available through core Txp tags, but not this (well, not without an absurd stack of conditional tags). To <code>glx_if_frontpage</code> it adds <code>txp:else /&gt;</code> compatibility, and a couple of attributes for more control.</p>

	<h2 id="usage">Usage</h2>

<pre>&lt;txp:soo_if_frontpage&gt;
...
&lt;txp:else /&gt;
...
&lt;/txp:soo_if_frontpage&gt;
</pre>

	<p><code>soo_if_frontpage</code> evaluates to <code>true</code> if the current page context is:</p>

	<ul>
		<li>an article list, and;</li>
		<li>not search results, and;</li>
		<li>not a listing of articles by category, and;</li>
		<li>not a listing of articles by author, and;</li>
		<li>not a listing of articles by month, and;</li>
		<li>not an image page, and;</li>
		<li>in one of the sections listed in <code>section</code> (defaults to the &#8216;default&#8217; section only), and</li>
		<li>(optionally) a single-page list or the first page of a multi-page list, if the <code>pg</code> attribute is set.</li>
	</ul>

	<h3 id="attributes">Attributes</h3>

	<p>None <span class="required">required</span>.</p>

	<ul>
		<li><code>section</code> <em>(Txp section name[s])</em><br />
Comma-separated list of allowed sections. Leave empty to restrict condition to the default (i.e. home) section. Use <code>section=&quot;*&quot;</code> to include all sections.</li>
		<li><code>pg</code> <em>(boolean)</em> <span class="default">default</span> false<br />
Whether or not to check for the &#8220;pg&#8221; <span class="caps">URL</span> query param (e.g., <code>http://my-site.com/?pg=2</code>).<br />
Set <code>pg=&quot;1&quot;</code> to allow only single-page lists or the first page of a multi-page list.</li>
	</ul>

	<h2 id="examples">Examples</h2>

	<h3 id="most">Most restrictive case</h3>

<pre>&lt;txp:soo_if_frontpage pg=&quot;1&quot;&gt;
... Home page ONLY
&lt;txp:else /&gt;
... any other page
&lt;/txp:soo_if_frontpage&gt;
</pre>

	<p>The above example returns true for the home page only. E.g., <code>http://example.com/</code> will cause the tag to return true, but <strong>any other standard Txp <span class="caps">URL</span> will return false</strong>.</p>

	<h3 id="least">Least restrictive case</h3>

<pre>&lt;txp:soo_if_frontpage section=&quot;*&quot;&gt;
... Home page, section front page, plus subsequent pages of a paginated list
&lt;txp:else /&gt;
... Indivdiual article; individual image; category, author, date, or search result lists
&lt;/txp:soo_if_frontpage&gt;
</pre>

	<p>The above example returns true on the home page, any section front page, and any paginated variation thereof. E.g., these pages would all return true:
	<ul>
		<li><code>http://example.com/</code></li>
		<li><code>http://example.com/?pg=2</code></li>
		<li><code>http://example.com/news/</code> (where &#8220;news&#8221; is a section name)</li>
		<li><code>http://example.com/news/?pg=7</code></li>
	</ul></p>

	<h2 id="history">Version History</h2>

	<h3>0.1.8 (1/14/2011)</h3>

	<p>Added check for global image context (i.e., the <code>p</code> query parameter)</p>

	<h3>0.1.7 (1/4/2011)</h3>

	<p>Documentation updated with descriptive examples. <em>(Thanks to Andre D for the suggestion.)</em></p>

	<h3>0.1.6 (10/7/2010)</h3>

	<p>More code cleaning, after I remembered that <code>$pretext</code> is already extracted in global scope</p>

	<h3>0.1.5 (10/7/2010)</h3>

	<p>Documentation update, code cleaning</p>

	<h3>0.1.4 (10/6/2010)</h3>

	<p>New feature: <code>section=&quot;*&quot;</code> is a shortcut for specifying all sections (including the default section)</p>

	<h3>0.1.3 (6/22/2010)</h3>

	<p>Fixed bug: section front pages now treated correctly (thanks, Victor)</p>

	<h3>0.1.2 (7/2009)</h3>

	<p>Added author and month search to the conditions to check against</p>

	<h3>0.1.1 (7/2009)</h3>

	<p>Added <code>pg</code> attribute; code and documentation cleaning; updated plugin template</p>

	<h3>0.1 (1/2008)</h3>

	<p><code>soo_if_frontpage</code> tag with <code>section</code> attribute</p>

 </div>