<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
 <generator>http://textpattern.com/</generator>
 <title>Textpattern Tips – Display navigation if newer or older values exist</title>
 <description>Display navigation if newer or older values exist - comments</description>
 <link>https://textpattern.tips/display-navigation-if-newer-or-older-values-exist</link>
 <atom:link href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist?f=comment-feed" rel="self" type="application/rss+xml" />
 <pubDate>Sun, 23 May 10 15:25:54 +0000</pubDate>

 <item>
     <title>Comment on Display navigation if newer or older values exist by Wornout</title>
     <link><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000694" id="c000694">1</a></link>
     <guid><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000694" id="c000694">1</a></guid>
     <pubDate>Tue, 13 Apr 10 10:33:01 +0000</pubDate>
     <description><![CDATA[<p>Great!<br>Just this morning I tried to apply this tip!<br>Unfortunately without success.<br>Thanks Stef</p>]]></description>
     <content:encoded><![CDATA[<p>Great!<br>Just this morning I tried to apply this tip!<br>Unfortunately without success.<br>Thanks Stef</p>]]></content:encoded>
     <dc:creator><a rel="nofollow" href="http://www.sideup.eu">Wornout</a></dc:creator>
 
</item>
<item>
     <title>Comment on Display navigation if newer or older values exist by Maniquí</title>
     <link><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000705" id="c000705">1</a></link>
     <guid><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000705" id="c000705">1</a></guid>
     <pubDate>Wed, 05 May 10 15:15:42 +0000</pubDate>
     <description><![CDATA[<p>Hi friends of <span class="caps">TXP</span> Tips,</p><p>I think I&#8217;ve spotted an error here. Nesting &lt;txp:older /&gt; (or &lt;txp:newer /&gt;) inside a &lt;txp:older&gt;&lt;/txp:older&gt; (or &lt;txp:newer&gt;&lt;/txp:newer&gt;) will give invalid markup, as the container creates a link (&lt;a&gt;) around the contained code, which already has a link.</p><p>Also, if I&#8217;m not wrong, the &#8220;duplicated&#8221; if_variable for creating opening and closing div tags for #navigation could be converted in just one if_variable at top (well, just below the line were the variable has been created) that will output just all or nothing.</p>]]></description>
     <content:encoded><![CDATA[<p>Hi friends of <span class="caps">TXP</span> Tips,</p><p>I think I&#8217;ve spotted an error here. Nesting &lt;txp:older /&gt; (or &lt;txp:newer /&gt;) inside a &lt;txp:older&gt;&lt;/txp:older&gt; (or &lt;txp:newer&gt;&lt;/txp:newer&gt;) will give invalid markup, as the container creates a link (&lt;a&gt;) around the contained code, which already has a link.</p><p>Also, if I&#8217;m not wrong, the &#8220;duplicated&#8221; if_variable for creating opening and closing div tags for #navigation could be converted in just one if_variable at top (well, just below the line were the variable has been created) that will output just all or nothing.</p>]]></content:encoded>
     <dc:creator><a rel="nofollow" href="http://julianlanderreche.com.ar">Maniquí</a></dc:creator>
 
</item>
<item>
     <title>Comment on Display navigation if newer or older values exist by Jonathan Stubbs</title>
     <link><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000706" id="c000706">1</a></link>
     <guid><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000706" id="c000706">1</a></guid>
     <pubDate>Thu, 06 May 10 10:38:49 +0000</pubDate>
     <description><![CDATA[<p>I&#8217;ll check on this Maniqui &#8211; in the meantime have any suggestions for changing the code?</p>]]></description>
     <content:encoded><![CDATA[<p>I&#8217;ll check on this Maniqui &#8211; in the meantime have any suggestions for changing the code?</p>]]></content:encoded>
     <dc:creator><a rel="nofollow" href="http://jonathanstubbs.com">Jonathan Stubbs</a></dc:creator>
 
</item>
<item>
     <title>Comment on Display navigation if newer or older values exist by Stuart</title>
     <link><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000718" id="c000718">1</a></link>
     <guid><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000718" id="c000718">1</a></guid>
     <pubDate>Sat, 22 May 10 13:50:50 +0000</pubDate>
     <description><![CDATA[<p>Does this work better?:-</p><pre><code>&lt;txp:if_article_list&gt;
&lt;txp:variable name="has_np" value='&lt;txp:older /&gt;&lt;txp:newer /&gt;' /&gt;
</code>
<code>&lt;txp:if_variable name="has_np" value=""&gt;
&lt;txp:else /&gt;
&lt;div id="navigation"&gt; &lt;!-- start entry navigation --&gt;
</code>
<code>&lt;div class="nav-links"&gt;&lt;txp:older&gt;&lt;txp:text item="prev" /&gt;&lt;/txp:older&gt;&lt;/div&gt;
</code>
<code>&lt;div class="nav-links"&gt;&lt;txp:newer&gt;&lt;txp:text item="next" /&gt;&lt;/txp:newer&gt;&lt;/div&gt;
</code>
<code>&lt;/div&gt; &lt;!-- end entry navigation --&gt;
&lt;/txp:if_variable&gt;
&lt;/txp:if_article_list&gt;
</code></pre><p>though you can still end up with an empty &#8220;nav-links&#8221; div if one or other of the Txp tags is empty.</p>]]></description>
     <content:encoded><![CDATA[<p>Does this work better?:-</p><pre><code>&lt;txp:if_article_list&gt;
&lt;txp:variable name="has_np" value='&lt;txp:older /&gt;&lt;txp:newer /&gt;' /&gt;
</code>
<code>&lt;txp:if_variable name="has_np" value=""&gt;
&lt;txp:else /&gt;
&lt;div id="navigation"&gt; &lt;!-- start entry navigation --&gt;
</code>
<code>&lt;div class="nav-links"&gt;&lt;txp:older&gt;&lt;txp:text item="prev" /&gt;&lt;/txp:older&gt;&lt;/div&gt;
</code>
<code>&lt;div class="nav-links"&gt;&lt;txp:newer&gt;&lt;txp:text item="next" /&gt;&lt;/txp:newer&gt;&lt;/div&gt;
</code>
<code>&lt;/div&gt; &lt;!-- end entry navigation --&gt;
&lt;/txp:if_variable&gt;
&lt;/txp:if_article_list&gt;
</code></pre><p>though you can still end up with an empty &#8220;nav-links&#8221; div if one or other of the Txp tags is empty.</p>]]></content:encoded>
     <dc:creator>Stuart</dc:creator>
 
</item>
<item>
     <title>Comment on Display navigation if newer or older values exist by Stuart</title>
     <link><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000719" id="c000719">1</a></link>
     <guid><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000719" id="c000719">1</a></guid>
     <pubDate>Sat, 22 May 10 13:59:50 +0000</pubDate>
     <description><![CDATA[<p>So that was the short version. If my memory serves me right you can keep resetting the variable so maybe this would remove any empty divs:-</p><pre><code>&lt;txp:if_article_list&gt;
&lt;txp:variable name="has_np" value='&lt;txp:older /&gt;&lt;txp:newer /&gt;' /&gt;
</code>
<code>&lt;txp:if_variable name="has_np" value=""&gt;
&lt;txp:else /&gt;
&lt;div id="navigation"&gt; &lt;!-- start entry navigation --&gt;
</code>
<code>&lt;txp:variable name="has_np" value='&lt;txp:older /&gt;' /&gt;
&lt;txp:if_variable name="has_np" value=""&gt;
&lt;txp:else /&gt;
&lt;div class="nav-links"&gt;&lt;txp:older&gt;&lt;txp:text item="prev" /&gt;&lt;/txp:older&gt;&lt;/div&gt;
&lt;/txp:if_variable&gt;
</code>
<code>&lt;txp:variable name="has_np" value='&lt;txp:newer /&gt;' /&gt;
&lt;txp:if_variable name="has_np" value=""&gt;
&lt;txp:else /&gt;
&lt;div class="nav-links"&gt;&lt;txp:newer&gt;&lt;txp:text item="next" /&gt;&lt;/txp:newer&gt;&lt;/div&gt;
&lt;/txp:if_variable&gt;
</code>
<code>&lt;/div&gt; &lt;!-- end entry navigation --&gt;
&lt;/txp:if_variable&gt;
&lt;/txp:if_article_list&gt;
</code></pre><p>and yes, I probably should have come up with that the first time but it is much easier to see when the code is there in front of you. ;)</p>]]></description>
     <content:encoded><![CDATA[<p>So that was the short version. If my memory serves me right you can keep resetting the variable so maybe this would remove any empty divs:-</p><pre><code>&lt;txp:if_article_list&gt;
&lt;txp:variable name="has_np" value='&lt;txp:older /&gt;&lt;txp:newer /&gt;' /&gt;
</code>
<code>&lt;txp:if_variable name="has_np" value=""&gt;
&lt;txp:else /&gt;
&lt;div id="navigation"&gt; &lt;!-- start entry navigation --&gt;
</code>
<code>&lt;txp:variable name="has_np" value='&lt;txp:older /&gt;' /&gt;
&lt;txp:if_variable name="has_np" value=""&gt;
&lt;txp:else /&gt;
&lt;div class="nav-links"&gt;&lt;txp:older&gt;&lt;txp:text item="prev" /&gt;&lt;/txp:older&gt;&lt;/div&gt;
&lt;/txp:if_variable&gt;
</code>
<code>&lt;txp:variable name="has_np" value='&lt;txp:newer /&gt;' /&gt;
&lt;txp:if_variable name="has_np" value=""&gt;
&lt;txp:else /&gt;
&lt;div class="nav-links"&gt;&lt;txp:newer&gt;&lt;txp:text item="next" /&gt;&lt;/txp:newer&gt;&lt;/div&gt;
&lt;/txp:if_variable&gt;
</code>
<code>&lt;/div&gt; &lt;!-- end entry navigation --&gt;
&lt;/txp:if_variable&gt;
&lt;/txp:if_article_list&gt;
</code></pre><p>and yes, I probably should have come up with that the first time but it is much easier to see when the code is there in front of you. ;)</p>]]></content:encoded>
     <dc:creator>Stuart</dc:creator>
 
</item>
<item>
     <title>Comment on Display navigation if newer or older values exist by Jonathan Stubbs</title>
     <link><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000720" id="c000720">1</a></link>
     <guid><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000720" id="c000720">1</a></guid>
     <pubDate>Sun, 23 May 10 07:16:04 +0000</pubDate>
     <description><![CDATA[<p>Nice code Stuart! Stef came up with this code for me on a site I am working on. This is the final revision which works ok:</p><pre><code>&lt;txp:if_article_list&gt;
&lt;txp:variable name="has_np" value='&lt;txp:older /&gt;&lt;txp:newer /&gt;' /&gt;
	&lt;txp:if_variable name="has_np" value=""&gt;
		&lt;txp:else /&gt;&lt;!-- entry navigation --&gt;
		&lt;div id="navigation"&gt;
</code>
<code>	&lt;txp:variable name="older" value='&lt;txp:older /&gt;' /&gt;
	&lt;txp:if_variable name="older" value=""&gt;
		&lt;txp:else /&gt;
   		&lt;div class="nav-links"&gt;&amp;#8592; &lt;txp:older&gt;&lt;txp:text item="older" /&gt;&lt;/txp:older&gt;&lt;/div&gt;
	&lt;/txp:if_variable&gt;
</code>
<code>	&lt;txp:variable name="newer" value='&lt;txp:newer /&gt;' /&gt;
	&lt;txp:if_variable name="newer" value=""&gt;
		&lt;txp:else /&gt;
   		&lt;div class="nav-links"&gt;&lt;txp:newer&gt;&lt;txp:text item="newer" /&gt;&lt;/txp:newer&gt; &amp;#8594;&lt;/div&gt;
	&lt;/txp:if_variable&gt;
</code>
<code>		&lt;/div&gt;&lt;!-- end entry navigation --&gt;
	&lt;/txp:if_variable&gt;
&lt;/txp:if_article_list&gt;
</code></pre>]]></description>
     <content:encoded><![CDATA[<p>Nice code Stuart! Stef came up with this code for me on a site I am working on. This is the final revision which works ok:</p><pre><code>&lt;txp:if_article_list&gt;
&lt;txp:variable name="has_np" value='&lt;txp:older /&gt;&lt;txp:newer /&gt;' /&gt;
	&lt;txp:if_variable name="has_np" value=""&gt;
		&lt;txp:else /&gt;&lt;!-- entry navigation --&gt;
		&lt;div id="navigation"&gt;
</code>
<code>	&lt;txp:variable name="older" value='&lt;txp:older /&gt;' /&gt;
	&lt;txp:if_variable name="older" value=""&gt;
		&lt;txp:else /&gt;
   		&lt;div class="nav-links"&gt;&amp;#8592; &lt;txp:older&gt;&lt;txp:text item="older" /&gt;&lt;/txp:older&gt;&lt;/div&gt;
	&lt;/txp:if_variable&gt;
</code>
<code>	&lt;txp:variable name="newer" value='&lt;txp:newer /&gt;' /&gt;
	&lt;txp:if_variable name="newer" value=""&gt;
		&lt;txp:else /&gt;
   		&lt;div class="nav-links"&gt;&lt;txp:newer&gt;&lt;txp:text item="newer" /&gt;&lt;/txp:newer&gt; &amp;#8594;&lt;/div&gt;
	&lt;/txp:if_variable&gt;
</code>
<code>		&lt;/div&gt;&lt;!-- end entry navigation --&gt;
	&lt;/txp:if_variable&gt;
&lt;/txp:if_article_list&gt;
</code></pre>]]></content:encoded>
     <dc:creator><a rel="nofollow" href="http://jonathanstubbs.com">Jonathan Stubbs</a></dc:creator>
 
</item>
<item>
     <title>Comment on Display navigation if newer or older values exist by Andrew Swihart</title>
     <link><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000721" id="c000721">1</a></link>
     <guid><a href="https://textpattern.tips/display-navigation-if-newer-or-older-values-exist#c000721" id="c000721">1</a></guid>
     <pubDate>Sun, 23 May 10 15:25:54 +0000</pubDate>
     <description><![CDATA[<p>Both of those make sense, basically what Maniqui was suggesting. Maybe worth updating the original post after contacting Stef.</p>]]></description>
     <content:encoded><![CDATA[<p>Both of those make sense, basically what Maniqui was suggesting. Maybe worth updating the original post after contacting Stef.</p>]]></content:encoded>
     <dc:creator><a rel="nofollow" href="http://andrewswihart.net">Andrew Swihart</a></dc:creator>
 
</item>

</channel>
</rss>