Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Search suddenly broken with 4.0.3
So I noticed yesterday that the search is broken on my site. Not sure how it happened. I looked through the FAQ, but couldn’t find anything that helped. I have made a few tweaks in the code but that made things worse. At first I was getting the number of articles, but no articles. Now I just get the search query term but no articles or number of articles. Any help would be apreciated. Here is the code I use:
search form: <code><form action=“index.php” method=“get”>
<label>Search Content</label>
<input type=“hidden” name=“s” value=“search” />
<input type=“text” name=“q” value=”“ size=“20” class=“text_input” />
<input type=“image” title=“submit form” value=“search” src=”/images/arrow.gif” class=“rollover”/>
</form></code>
and on the page template used for section “search”
<code><div id=“content” class=“toc search_results”>
<h1>Search Results for “<txp:q />” <strong><txp:search_result_count/></strong></h1>
<txp:article />
</div></code>
to see an example see: http://www.fillip.ca/index.php?s=search&q=art&x=0&y=0
For what its worth, I implimented a mod that allowed two custom fields to be searched. But like I said, all was working fine for quite some time.
Any help would be appreciated.
Offline
Re: Search suddenly broken with 4.0.3
Did a little more thinking, and figured I probably would need to remodify the publish.php file to get the custom field searching online. Worked like a charm. Unfortunately I deleted the code that outputed the number of results, and <txp:search_result_count/> doesn’t seem to work..
Offline
Re: Search suddenly broken with 4.0.3
sorry to bump this, but I am still stuck. Blast!
Offline
#4 2006-01-16 15:20:33
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search suddenly broken with 4.0.3
1. <txp:search_result_count />
won’t work if the article tag comes after it. You can get it done by using pgonly=1 (read zem’s article).
2. Have you tried wrapping the code on your page in <txp:if_search></txp:if_search>
?
Offline
Re: Search suddenly broken with 4.0.3
The pgonly=1 did the trick! Thanks for this.
Offline
Pages: 1