Difference: SearchPatternCookbook (6 vs. 7)

Revision 72013-04-23 - TWikiContributor

Line: 1 to 1
 
META TOPICPARENT name="FormattedSearch"

Search Pattern Cookbook

Line: 188 to 188
 However, the $parent link fails if the topic has no parent set ($parent will be empty). You can use some TWiki:Plugins/SpreadSheetPlugin magic to conditionally link to the parent or to WebHome:
Changed:
<
<
$percntCALC{$IF($EXACT($parent,),,$NOP( * $parent))}$percnt
>
>
$percntCALCULATE{$IF($EXACT($parent,), , $NOP( * $parent))}$percnt
 

So the total Search query to find a topic's parent topic is:

Changed:
<
<
>
>
 

Test Case

The parent topic of this topic is:

Changed:
<
<
>
>
 

Solution 3: Using IF statement

This pattern can be rewritten using %IF%, removing the dependency on SpreadSheetPlugin:
Line: 255 to 255
 

Test case

Added:
>
>
  Public webs of TWiki.

Changed:
<
<
Search: WebHome

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

>
>
Search: WebHome

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

Number of topics: 1
<--/patternSearchResultCount-->

 
Line: 269 to 270
 TIP For private webs, or any other webs you wish to exclude from the display, use "on" for the Exclude web from a web="all" search setting in the relevant web's WebPreferences topic.

Alternative solution

Added:
>
>
  This result can also be accomplished with the %WEBLIST% variable.

Changed:
<
<
>
>
 
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.SearchPatternCookbook.