We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
create new tag
, view all tags

Question

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!

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RedHat? 8
Web server: Apache
Perl version: 5.6.1
Client OS: OSX 10.28
Web Browser: Netscape 7.1

-- KarstynMcCoy - 03 Oct 2003

Answer

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:

  1. 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 |"
  2. 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 |"
  3. 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):
      • AnsweredQuestions
    • 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
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback