Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
I can't get if_search_results working ...
… especially the <txp:else />
part … !?
I follow these steps according > www.justinfrench.com
I’m using > <txp:output_form form="search_input" />
on the pages
I have a section and a page called ‘search’
The form search_input:
<form action="<txp:site_url />index.php" method="get">
<input type="hidden" name="s" value="search" />
<input type="text" name="q" value="" size="20" />
<input id="search" src="<txp:site_url />design/search.gif" type="image" value="Gaon!" />
</form>
The form search_results:
<txp:if_search_results>
<div class='search_result'>
<p class='posted'>Gevonden in: <txp:search_result_title /></p>
<p>"<txp:search_result_excerpt limit="99" hilight="strong" break="…" />"</p>
</div>
<txp:else />
<div class='search_result'>
<p class='posted'>De zoekterm <strong><txp:search_term /></strong> heeft geen resultaten opgeleverd.</p>
</div>
</txp:if_search_results>
Try for yourself at > www.dorpshuiswapse.nl (under construction!)
Last edited by RedFox (2009-12-14 19:21:20)
Offline
Re: I can't get if_search_results working ...
Seems to work for me
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: I can't get if_search_results working ...
MattD wrote:
Seems to work for me
Hi MattD … yes, I know, but what if you put no character(s) at all into the searchbox and then hit ‘gaon!” Where is “De zoekterm <strong><txp:search_term /></strong> heeft geen resultaten opgeleverd.” … ?
Last edited by RedFox (2009-12-14 19:26:35)
Offline
Re: I can't get if_search_results working ...
How/where are you calling the form “search_results”?
You have to use the searchform
attribute on txp:article
tag.
Like this: <txp:article searchform="search_results" />
.
Also, you will probably have to include a txp:article pgonly="1"
tag in your search page template, before the if_search_result, so Textpattern knows that there are (or not) search results.
Offline
Re: I can't get if_search_results working ...
Hi maniqui … according the mentioned article it isn’t needed. Nevertheless I tried, but it doesn’t work either!
Offline
Re: I can't get if_search_results working ...
maniqui is correct – check Textbook always if in doubt…see this post of mine from a few days back for a code example, or check some other articles..
Offline
Re: I can't get if_search_results working ...
Offline