Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Today 07:11:39

PeterB
New Member
From: Roosendaal, Netherlands
Registered: 2026-02-06
Posts: 14
Website

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

#2 Today 07:59:00

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,214
Website GitHub

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

#3 Today 08:11:35

PeterB
New Member
From: Roosendaal, Netherlands
Registered: 2026-02-06
Posts: 14
Website

Re: Search results / display

The term doesn’t belong to a title, the word “boog” is only to find in the articles.

Offline

#4 Today 08:46:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,484
Website GitHub

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

#5 Today 09:03:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,214
Website GitHub

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

#6 Today 09:31:56

PeterB
New Member
From: Roosendaal, Netherlands
Registered: 2026-02-06
Posts: 14
Website

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

#7 Today 09:52:22

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

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

#8 Today 10:15:15

PeterB
New Member
From: Roosendaal, Netherlands
Registered: 2026-02-06
Posts: 14
Website

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

#9 Today 11:52:06

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: Search results / display

Thank you. I think the unclosed center tag in ...<th><center><b>Latijnse Naam</b></center</th>... explains it. This is not really a txp bug, that’s how php strip_tags() function works.

Offline

#10 Today 12:14:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,484
Website GitHub

Re: Search results / display

Great sleuthing, etc! Good spot. That hopefully explains it. Thought it was a bit strange.


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

#11 Today 12:32:58

PeterB
New Member
From: Roosendaal, Netherlands
Registered: 2026-02-06
Posts: 14
Website

Re: Search results / display

Good observation, this solved the problem, thanks.

Offline

#12 Today 12:46:58

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,214
Website GitHub

Re: Search results / display

Bloke wrote #342732:

Great sleuthing, etc! Good spot. That hopefully explains it. Thought it was a bit strange.

Wow yes. Great idea. Without that, we would have gone round in circles.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB