cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
You are here: Foswiki>Tasks Web>Item883 (04 Oct 2010, KennethLavrsen)Edit Attach

Item883: Make the SEARCH zeroresults parameter a format string

pencil
Priority: Enhancement
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component: SEARCH FORMAT
Branches:
Reported By: SvenDowideit
Waiting For:
Last Change By: KennethLavrsen
%SEARCH{
    web="System"
   "SvenThinksThereShouldBeNoSuchTopic"
    nototal="on" 
    zeroresults="on" 
}%

Searched: SvenThinksThereShouldBeNoSuchTopic

from VarSEARCH

zeroresults="off" Suppress all output if there are no hits zeroresults="on", displays: "Number of topics: 0"
nototal="on" Do not show number of topics found Show number

While the docco is totally vague about what happens when you combine the 2 :/

So I'm thinking that we can take the oportunity to turn zeroresults into a format field too

ie,
  • zeroresults="$count results found" would work..
  • zeroresults="off" would show nothing as now
  • zeroresults="on" would show the total when = 0 independently of =nototal

(basically, it would be better if zeroresults could be used to optionally over-ride nonoise when otherwise you just get a blank page.)

-- SvenDowideit - 28 Jan 2009

adding unit tests and fix from Item8785, and then added feature.

-- SvenDowideit - 29 Mar 2010

ItemTemplate edit

Summary Make the SEARCH zeroresults parameter a format string
ReportedBy SvenDowideit
Codebase trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component SEARCH FORMAT
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins distro:d6913e477e7b distro:256ad2bf018d distro:9e83530453c9
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r8 - 04 Oct 2010, KennethLavrsen - This page was cached on 01 May 2018 - 23:04.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License