Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2008-09-15 22:25:46
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search Page
Edited my post.
Offline
Re: Search Page
Urgh I’m super confused now, which tags am I using here :S
I have the if_search to detect if we are searching or not, ie you have searched or are just on the search page
and I have the if_search_results to detect if we have search results or not and show either a yes or no answer
Which one needs wrapping inside the other (if at all).
Thank you
~ Cameron
Offline
Re: Search Page
Not sure why it isn’t working, but for clarity, I would write the last part of your code as this:
<txp:if_search>
<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>
Offline
Re: Search Page
okies, now the search ALWAYS says no results were found (it doesnt display them either) :P
there are several articles called Lorem Ipsum, and here is a test search: http://www.simplecandy.com/search?q=lorem+ip
But the results don’t show :S
Last edited by driz (2008-09-15 22:56:21)
~ Cameron
Offline
#29 2008-09-15 23:04:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search Page
We forgot to tell you about pgonly
: just put <txp:article pgonly="1" />
before the if_search_results tag. It doesn’t display anything but it is needed to count the articles.
<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>
Offline
Re: Search Page
Out of curiosity, how many be default (search links) will be displayed and do they have pagination?
And the code changed fixed the bug, cheers :) x
Last edited by driz (2008-09-15 23:10:19)
~ Cameron
Offline
#31 2008-09-15 23:20:18
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search Page
Search :)
Edit: OK, that search id didn’t last very long… if you search the forum for pagination AND search AND results you will find some useful topics.
Last edited by els (2008-09-16 14:37:45)
Offline
Re: Search Page
<txp:article/> will display all articles unless told to do otherwise by it’s Attributes
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Search Page
MattD wrote:
<txp:article/> will display all articles unless told to do otherwise by it’s Attributes
No, if I’m not mistaken the default for limit is 10 (see limit attribute in textbook)
Set limit="999"
to get ‘all’ (=up to 999) results.
Last edited by jakob (2008-09-16 06:50:58)
TXP Builders – finely-crafted code, design and txp
Offline
Re: Search Page
Doh!
limit="integer"
The number of articles to display. Default is 10.
Note to self: Read before posting Matt!
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Search Page
Using that code I am getting…
When a search is met at the bottom after the search results by default: “These articles match your search request:”
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.
Note – Edit: I have started a new thread about this topic here: http://forum.textpattern.com/viewtopic.php?id=28563
Last edited by mattmikulla (2008-10-07 21:59:25)
Art Rogue – Fine Art Photography
Offline