Tags:
create new tag
, view all tags

Question

I want to retrieve the parent of a topic. This works in principle with:

-

The raw code:

%SEARCH{ "^%BASETOPIC%$" scope="topic" web="%BASEWEB%" regex="on" nosearch="on" nototal="on" zeroresults="off" format="- $parent(15, ...) %BR%" }%

But when no parent is set, I don't want to display anything.

How can I turn off the results when nothing is found?

Related: WebSideNav

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories:  

-- ArthurClemens - 06 Feb 2006

Answer

You can do that with a SpreadSheetPlugin CALC that gets evaluated after the search:

%SEARCH{ "^%BASETOPIC%$" scope="topic" web="%BASEWEB%" regex="on" nosearch="on" nototal="on" zeroresults="off" format="$percntCALC{$IF($EXACT($parent,), , - $parent(15, ...) %BR%)}$percnt" }%

-- PeterThoeny - 06 Feb 2006

Thanks. But this gets way too complicated for such a simple question. I suggest a new parameter to SEARCH in case of no results: alt="nothing found".

-- ArthurClemens - 06 Feb 2006

 
Topic revision: r4 - 2006-02-06 - ArthurClemens
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.