I have a working formatted search that searches on form elements. On the first summary line of each of the search results is an
Warning: Can't find topic "".""
statement. On the results page it displays the 'code' of the
Warning: Can't find topic "".""
statement - which in my case is actualy better then processing the statement!
What I would like to do is to be able to exclude that first line of the summary. Here is my search arg:
%SEARCH{ "[N]oteStatus.*(td..td|value\=).*%TOPIC%" casesensitive="on" regex="on" nosearch="on" order="modified" reverse="on" format="| *[[$topic]]*: $summary | $date - $rev |"}%
A sample of the results:
DownloadableTechHelp: INCLUDE{EsTopicHeader} Back to Web Desk New Downloadable Tech Help!! There are now PDF versions of our on-line help files for configureing both email and internet dial-up access. This will ...
Would love some good suggestions!
--
KarstynMcCoy - 03 Oct 2003
There is a fairly new feature of TWiki that will help you "workaround" this problem (AFAIK, you can't do it directly) — IIRC, it is called "named includes" or something like that. (It might require a plugin.)
--
RandyKramer - 04 Oct 2003
The
$summary is currently hard coded, that is you cannot exclude the first line or skip some text. There are several way to get a custom summary:
- Build your own summary, one paragraph:
- The format contains a
$pattern() that skips over the INCLUDE and grabs the first paragraph
- Not tested example:
format="| *[[$topic]]*: $pattern(.*?INCLUDE.*?}\%\s*([^\n\r]+).*) | $date - $rev |"
- Build your own summary, number of chars:
- Similar to the first one, but apply a pattern with a limited number of chars
- Not tested example:
format="| *[[$topic]]*: $pattern(.*?INCLUDE.*?}\%\s*([^\n\r]{162}[a-ZA-Z0-9]*|[\n\r]+).*) | $date - $rev |"
- Use a form field for summary:
- Add a
TopicSummary form field where users add a one line summary
- Your INCLUDE on top can show the heading and summary based on a regex SEARCH on the INCLUDINGTOPIC. Example pulling out the SupportStatus from this topic (edit to see how):
- Your SEARCH that builds the index pulls out the
TopicSummary form field: format="| *[[$topic]]*: $formfield(TopicSummary) | $date - $rev |"
--
PeterThoeny - 08 Oct 2003
TWikiBetaRelease2004x10x30 has some more control over the summary format to exclude/expand
TWikiVariables. See latest
FormattedSearch docs.
--
PeterThoeny - 21 Feb 2005
Topic revision: r6 - 21 Feb 2005 - 22:17:53 -
PeterThoeny