Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Removing TXP's default display messages after search results
When a search is met at the bottom after the search results by default: “These articles match your search request:”
Edit Note: I am directing my search page to a section called search – mysite.com/search/
When no articles can be found: Sorry, we were not able to find a page matching your search request blahblah.
And: Seems like you are looking for a very common search term. You’d better use a more specific search phrase.
How can I get rid of those statements. They are unstyled and I would like them removed.
This is basically the code I am using:
<txp:if_search>
<txp:article pgonly=“1” />
<txp:if_search_results>
<p>These articles match your search request: </p>
<txp:article form=“search_results” sort=“Section asc” />
<txp:else />
<p>Sorry, we were not able to find a page matching your search request <strong><txp:search_term /></strong>.</p>
</txp:if_search_results>
<txp:else />
<p>No Content Available…</p>
</txp:if_search>
Last edited by mattmikulla (2008-10-07 17:03:38)
Art Rogue – Fine Art Photography
Offline
Re: Removing TXP's default display messages after search results
<txp:if_search>
<txp:article pgonly="1" />
<txp:if_search_results>
<txp:article form="search_results" sort="Section asc" />
</txp:if_search_results>
</txp:if_search>
Offline
Re: Removing TXP's default display messages after search results
Using the exact code posted by jm:
<txp:if_search>
<txp:article pgonly="1" />
<txp:if_search_results>
<txp:article form="search_results" sort="Section asc" />
</txp:if_search_results>
</txp:if_search>
I am still getting default messages. Textpattern is inserting them automatically.
Search result met:
These articles match your search request:
Search results not met:
Seems like you are looking for a very common search term. You’d better use a more specific search phrase.
Last edited by mattmikulla (2008-10-07 15:31:34)
Art Rogue – Fine Art Photography
Offline
#4 2008-10-07 16:09:30
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Removing TXP's default display messages after search results
You are not by chance directing the search results to another section/page template, that doesn’t have this code but does have an article tag?
Anyway, I’ve never noticed that Txp displays these messages by default. You’re not using a search plugin?
Offline
Re: Removing TXP's default display messages after search results
I’m directing the search to a section of “search” – mysite.com/search/.
I am not using a plugin.
I have learned that directing search results to your index page is not good for SEO purposes. Google is indexing search queries so I plan to set up the section “search” and and a robots no index no follow.
My guess is that TXP has something built into it when using the if_search_results that needs to be purged or made into an attribute.
Last edited by mattmikulla (2008-10-07 17:00:03)
Art Rogue – Fine Art Photography
Offline
Re: Removing TXP's default display messages after search results
I fixed it. I had some extra code hiding in a form from a previous experiment. I feel like a moron.
Art Rogue – Fine Art Photography
Offline