Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Search results / display
When I search my website for the word “boog,” I currently get 11 results. The first result shows the sentence containing the word “boog,” but the other 10 do not. How can I make the results for these 10 the same as result 1?
Offline
Re: Search results / display
Out of curiosity, does the search term also appear in a sentence in the body or excerpt field for those other search results? If, for example, the search term is in the title, then it probably won’t show in the context of a sentence.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Search results / display
The term doesn’t belong to a title, the word “boog” is only to find in the articles.
Offline
Re: Search results / display
Weird. Assuming you’re using a stock search_results form, do any of the articles in the other lists have content in their Excerpt field? Even if it’s a space or a newline?
The default search_results form checks that and displays it if it’s in use. If it’s empty, only then does it display the in-context result.
Alternatively, you could try changing the search_results form and replace the <txp:if_excerpt>...</txp:if_excerpt> block with just <txp:search_result_excerpt />
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Search results / display
Ah yes, I see that now on your site. Hmm. I’m not sure why it only seems to show results for article B, although the other articles have essentially the same structure.
I tried with other terms that appear on other articles but not in Article B and was unsuccessful in getting a search excerpt to show, only for Article B.
Bloke wrote #342721:
do any of the articles in the other lists have content in their Excerpt field? Even if it’s a space or a newline?
It looks to me from the page source that you’re using the standard search_results form to output the results and I see empty p tags which suggests there are not excerpts in those articles and that the search_results_excerpt is simply not giving you any output. But if you have modified the search results output, could you share your search results form with us?
Maybe someone else has an idea? The search results are found, just the excerpt is not showing.
EDIT: I wondered if txp is only showing the first search result excerpt it finds, but searching for another term that appears in other articles but not in Article B didn’t corroborate that.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Search results / display
I did not modified the result forms, all the articles have a empty excerpt, only the sections have a discription.
For a test I filled “Lijst A” also with some words, also the word “boog” but the result are the same, only Lijst B gets a description.
Offline
Re: Search results / display
@PeterB can you past the exact body source of Lijst A here, please, so we could try to reproduce the issue?
Offline
Re: Search results / display
<b>Lijst A:</b>
<table style=“width:90%”>
<tr>
<th><center><b>Nederlandse Naam</b></center></th>
<th><center><b>Latijnse Naam</b></center</th>
</tr>
<tr>
<td>Aboog</td>
<td>test</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
<b>Lijst B:</b>
<table style=“width:90%”>
<tr>
<th><center><b>Nederlandse Naam</b></center></th>
<th><center><b>Latijnse Naam</b></center></th>
</tr>
<tr>
<td>Beatricebladroller</td>
<td>Aethes Beatricella</td>
</tr>
<tr>
<td>Berkenspikkelspanner</td>
<td>Aethalura Punctulata</td>
</tr>
<tr>
<td>Bitterzoetmot</td>
<td>Acrolepia Autumnitella</td>
</tr>
<tr>
<td>Bleekschouderuil</td>
<td>Acontia Lucida</td>
</tr>
<tr>
<td>Bonte Bessenvlinder</td>
<td>Abraxas Grossulariata</td>
</tr>
<tr>
<td>Bont Schaapje</td>
<td>Acronicta Aceris</td>
</tr>
<tr>
<td>Brandnetelkapje</td>
<td>Abrostola Tripartita</td>
</tr>
<tr>
<td>Bruingele Boogbladroller</td>
<td>Acleris Aspersana</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
Offline
Pages: 1