Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Site Search
I’m really happy with the redesign of the Wandering Italy Blog, as it seems to be twice as fast as before. There are a few issues I need to fix but one that has me stumped is that when I use site search for a term that doesn’t appear on the site I get a pretty blank page with just the title. There isn’t a “no search matches” displayed when that occurs, which I’d expect because I’m using the stock search_display form and only the title and pagination from it seem to work. Any clues?
james
Offline
Re: Site Search
It looks like this part of your search_display
is either missing or not processed, please check:
<txp:if_search_results>
<!-- if search result count greater than 200 then display excessive results message, otherwise show search result count -->
<txp:if_search_results max="200">
<h3>
<txp:search_result_count />
<txp:text item="matching_search_request" />
<q><txp:search_term /></q>
</h3>
<txp:else />
<h3>
<txp:text item="too_common_search_term" />
<q><txp:search_term /></q>
</h3>
</txp:if_search_results>
<!-- if no search results, then display no search results message -->
<txp:else />
<h3>
<txp:text item="no_search_matches" />
</h3>
</txp:if_search_results>
Offline
Re: Site Search
etc wrote #329558:
It looks like this part of your
search_display
is either missing or not processed, please check:
<txp:if_search_results>...
It’s there, it’s just not being processed.
Offline
Re: Site Search
jrmartin wrote #329563:
It’s there, it’s just not being processed.
Intriguing. What txp version are you using, 4.8.4 or 4.8.5? Anyway
- check whether all files have been uploaded ok (via Diagnostics)
- check eventual error messages in Debug mode
- check
secondpass
preference value (intxp_prefs
table) if set - replace the opening
<txp:if_search_results>
with<txp:if_search_results[-1]>
to try to fix it manually
Offline
Re: Site Search
It’s version 8.4, but my wife’s site, Martha’s Italy, is the same with an earlier version.
A relevant piece of the debugging, I think:
96.31 | | [ ~~~ secondpass (1) ~~~ ]
96.33 | | [true]
96.54 | 0.10 | <txp:if_search_results>
96.55 | | [true]
96.56 | 0.08 | <txp:if_search_results max="200">
96.58 | | [true]
96.59 | 0.02 | <txp:search_result_count />
96.61 | 0.02 | <txp:text item="matching_search_request" />
96.63 | 0.01 | <txp:search_term />
96.64 | | </txp:if_search_results>
96.65 | | </txp:if_search_results>
96.66 | | [ ~~~ secondpass (2) ~~~ ]
96.72 | 0.00 | [Callback_event: 'textpattern_end', step='', pre='0']
Offline
Re: Site Search
Mystery. The parser seems to enter the block, but outputs nothing, not even <txp:text />
. Not even this html comment (assuming it’s still in your search_display
form):
<!-- if search result count greater than 200 then display excessive results message, otherwise show search result count -->
And does outer <txp:if_search_results[-1]>
not help?
Offline
Re: Site Search
Well, that did it. What does the -1 do?
james
Offline
Offline
Re: Site Search
Yeah, the site has some odd things going on at times I can’t explain either. Thanks very much for your help in coming up with a solution. I’m off to fix my wife’s site now…
james
Offline
Re: Site Search
You are welcome, we are not fond of bugs in the wild, please don’t hesitate to report back.
Offline
Re: Site Search
Just in case this is a bug, I used the same fix on Martha’s Italy and the version is the same, 4.8.4.
j
Last edited by jrmartin (2021-03-29 20:12:34)
Offline
Re: Site Search
jrmartin wrote #329572:
Just in case this is a bug
Can not tell for sure, you seem to be the first person it bites. Sometimes it is plugins interference, or an atypical server config.
If you have a chance to test
<txp:php>
echo get_pref('secondpass', 1);
</txp:php>
in some article or form, that might help.
Offline
Pages: 1