Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-12-17 19:58:28

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

How to style (these) search_results?

The search page as a result of searching with ‘welkom’ > www.dorpshuiswapse.nl/txp/search?q=welkom

One article with ‘welkom’ in the body text. No problem!

Second article with ‘welkom’ in … the title!

1. Can there be a ‘highlighting’ of (a part of) the title?
2. (Or) can I get rid of the “” ?

Screendump of that page >

Form (‘search_results’) >

<div class='search_results'>
<p class='posted'>Gevonden in: <txp:search_result_title /></p>
<p>"<txp:search_result_excerpt limit="99" hilight="strong" break="&hellip;" />"</p>
</div>

I’m not good with <if_else>, <if_variable> or <if_whatsoever> … anybody? Thanks!

Last edited by RedFox (2009-12-17 20:14:07)

Offline

#2 2009-12-17 20:11:55

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to style (these) search_results?

2. (Or) can I get rid of the “” ?

There they are:

<p>"<txp:search_result_excerpt limit="99" hilight="strong" break="&hellip;" />"</p>

1. Can there be a ‘highlighting’ of (a part of) the title?

Not as far as I know.

Last edited by els (2009-12-17 20:14:13)

Offline

#3 2009-12-17 20:16:42

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: How to style (these) search_results?

Els wrote:

There they are:…

Eh … Els, me not begrijpo! I want to get rid of the “” in the second result!

Last edited by RedFox (2009-12-17 20:19:19)

Offline

#4 2009-12-17 20:25:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to style (these) search_results?

:) You can only get rid of the quotes in all search results I’m afraid. Don’t think we have a conditional tag like this yet: <txp:if_search_result_only_in_article_title>

I meant you can remove the quotes here: <p>"..."</p>

Oh wait, I think it is possible. Hang on a moment.

Last edited by els (2009-12-17 20:26:02)

Offline

#5 2009-12-17 20:32:08

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to style (these) search_results?

<txp:variable name="body_result" value='<txp:search_result_excerpt />' />

<txp:if_variable name="body_result" value="">
     <p>The search term was found only in the article title.</p><!-- or leave empty -->
<txp:else />
     <p>"<txp:search_result_excerpt limit="99" hilight="strong" break="&hellip;" />"</p>
</txp:if_variable>

Offline

#6 2009-12-17 21:09:40

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: How to style (these) search_results?

Offline

#7 2009-12-17 23:20:06

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to style (these) search_results?

:-D

Offline

Board footer

Powered by FluxBB