Search using non-default section
This TXP tips covers the same ground as the previous tip on Search with Textpattern, but uses a separate section and page for the search results.
The Textpattern default method (which uses the default page to display search results) may work well for you, but in case you want to separate your search results (SEO reasons for example), follow the simple steps below.
Create your search form
<h2>Site search</h2>
<txp:search_input label="" section="search" button="Go" size="15" wraptag="p" />
Create your search page template
In your Presentation tab, create a new page called search.
Create a search section
In your Sections tab, create a new section called search and set all options to no. Choose search as the page to use.
Place the search results code in your search page template
<txp:article limit="10" pgonly="1" />
<h2><txp:search_result_count text="search results" /> for "<txp:page_url type="q" />"</h2>
<txp:article limit="10" />
<p><txp:older>» Next results »</txp:older></p>
<p><txp:newer>« Newest results «</txp:newer></p>
Place the search form in your page templates
Wherever you want the search form to appear in your various page tenplates, call it using <txp:output_form form="search" />.
5 Comments - Comments RSS Feed
Randy
# 11 August 2011
I am using the tutorial for my current project to handle search results – and it worked like a charm. Ten search results displayed on the first page. My problem is that when I try to go to page 2 (…/search/2/) or any page down the line —- it kicks me to the generic article list found in the default article form.
Initally, I thought it may have something to do with <txp:newer>/<txp:older> tags, but I get the same results when using the soo_page_numbers plugin
Any guidance or feedback would be greatly appreciated.

Mischa van der Spek
# 11 January 2011
How do I use this when making use of Sticky articles?!
Thanks,
Mischa