Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-11 22:41:42

PCM
New Member
Registered: 2005-12-13
Posts: 6

How do I eliminate Sticky from search results page?

I have the sticky assigned to a section that places articles on the homepage. I also have news and events that dynamically show up underneath the sticky (hence the need for a sticky). I’ve been fussing with <txp:if_search> tags but can’t get anything to work. Any advice on how to eliminate the sticky from search results page?

Here’s my code for TXP:

<code>
<txp:if_article_list>
<txp:article form=“static” status=“sticky” sortby=“id” sortdir=“asc” />
<txp:article />
</txp:if_article_list>

<txp:if_individual_article>
<div class=“article_footer”>
Return to <a href=”—-”>Homepage</a> | <a href=”—-”>View all News & Events</a>
</div>
</txp:if_individual_article>
</code>

Thanks!

Offline

#2 2006-07-12 00:57:22

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: How do I eliminate Sticky from search results page?

if_search should do it. You might be interested in glx plugins though (more powerful).

<pre>
&lt;txp:if_article_list&gt; &lt;txp:if_search&gt; &lt;h2&gt;search results&lt;/h2&gt; &lt;txp:article limit=&quot;999&quot; /&gt; &lt;txp:else /&gt; &lt;!—if not searching—&gt; &lt;txp:article form=&quot;static&quot; status=&quot;sticky&quot; sortby=&quot;id&quot; sortdir=&quot;asc&quot; /&gt; &lt;txp:article /&gt; &lt;/txp:if_search&gt;

&lt;txp:else /&gt; &lt;!— if individual article —&gt; &lt;div class=&quot;article_footer&quot;&gt;Return to &lt;a href=&quot;—-&quot;&gt;Homepage&lt;/a&gt; | &lt;a href=&quot;—-&quot;&gt;View all News &amp; Events&lt;/a&gt;&lt;/div&gt;
&lt;/txp:if_article_list&gt;
</pre>

Last edited by deldindesign (2006-07-12 00:58:53)

Offline

#3 2006-07-12 01:22:35

PCM
New Member
Registered: 2005-12-13
Posts: 6

Re: How do I eliminate Sticky from search results page?

Thanks!

Offline

Board footer

Powered by FluxBB