Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-30 08:36:42

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Search current section only not working

It shows results form all sections. I followed this guide

My search form looks like this…

<form id="search-box" method="get" action="/<txp:section />">
<input class="text" type="text" name="q" value="" size="15" />
<input class="button" type="submit" value="Search" />
</form>

My page template looks like this…

<txp:if_article_list>

<txp:if_search>
<h1>Site Search</h1>
<txp:article searchall="0" pgonly="1" searchsticky="1" />
<p>Found <em><txp:search_result_count /></em> for "<span class="highlight"><txp:search_term /></span>"</p>


<txp:article searchall="0" searchsticky="1" limit="10" /> 


<p class="paginate"><txp:older><txp:text item="older" /></txp:older><txp:chh_if_data> | <txp:newer><txp:text item="newer" /></txp:chh_if_data></txp:newer></p>

<txp:else />
<txp:article status="sticky" form="homepage" />
</txp:if_search>


<txp:else /> 
<txp:article status="sticky" form="homepage" />                       
<txp:article />
</txp:if_article_list>

Last edited by FireFusion (2008-04-30 08:36:59)

Offline

#2 2008-04-30 10:23:39

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Search current section only not working

Have you tried Pedro’s proposition <txp:search_input section="your_section_name" /> literally?
Then, one step further, surrounded with asy_wondertags to use <txp:section /> as a value?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2008-04-30 13:54:56

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Search current section only not working

uli wrote:

Have you tried Pedro’s proposition <txp:search_input section="your_section_name" /> literally?
Then, one step further, surrounded with asy_wondertags to use <txp:section /> as a value?

You can hard-code the form with out any loss as it outputs the same code – and it doesn’t do anything more.

Offline

Board footer

Powered by FluxBB