Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2012-12-11 14:38:54
- woof
- Member
- Registered: 2004-08-01
- Posts: 128
[textile] Exclude content between txp:hide tags from search results?
I’m using txp:hide
tags in the body and excerpt field of articles to include notes and to “comment out” sections of text, but I’ve found that the hidden text remains discoverable via the search function and is output by the txp:search_result_excerpt
tag
Is there a way to hide such content from search? Or if not, to prevent it from being output by txp:search_result_excerpt
?
Offline
Re: [textile] Exclude content between txp:hide tags from search results?
woof wrote:
Is there a way to hide such content from search? Or if not, to prevent it from being output by
txp:search_result_excerpt
?
- Not really. TXP search looks for its text inside not textiled and not parsed body, so everything therein is searchable. The “easiest” solution I can see is to replace
<txp:hide />
by Textile###.
comments, and the default<txp:search_input />
with<txp:etc_search query="{Title,Body_html}" />
. This will search in textiled body, with comments stripped out, but has some drawbacks. - Yes, if you replace
<txp:hide />
by Textile###.
comments.
I may overlook something, though.
Edit: it was etc_search
, of course, not etc_query
.
Last edited by etc (2012-12-11 20:58:00)
Offline
#3 2012-12-11 17:35:27
- woof
- Member
- Registered: 2004-08-01
- Posts: 128
Re: [textile] Exclude content between txp:hide tags from search results?
Thank you Oleg
Offline
#4 2012-12-11 19:29:03
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [textile] Exclude content between txp:hide tags from search results?
etc wrote:
Textile
###.
comments.
And I thought I knew everything about Textile… Thanks, Oleg, never heard of this one before :)
Offline
Re: [textile] Exclude content between txp:hide tags from search results?
Els wrote:
never heard of this one before :)
My knowledge is only 3 hours older than yours. It even works on this forum, see the comment below :)
Offline
#6 2012-12-11 22:48:42
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [textile] Exclude content between txp:hide tags from search results?
etc wrote:
see the comment below :)
:)
Offline
Re: [textile] Exclude content between txp:hide tags from search results?
From now on all of my forum posts will have hidden content.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Offline
#9 2012-12-12 19:41:14
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [textile] Exclude content between txp:hide tags from search results?
Offline
#10 2012-12-12 20:14:24
- woof
- Member
- Registered: 2004-08-01
- Posts: 128
Re: [textile] Exclude content between txp:hide tags from search results?
Haha. Heads up: commented out text shows in the clear in the forum’s “reply to topic” notification email. ;-)
Offline