How can I report a list of topic children, with a total number of topics under each?

The solution requires understanding of these things: Two strategies are shown below:

nesting with escapes

%SEARCH{
  "parent.name='WebHome'"
  type="query"
  header="| *Topic* | *Children* | *Modified* | *By* |"
  format="| [[$web.$topic][$topic]] | $percntSEARCH{
    \"parent.name='$topic'\"
    type=\"query\"
    nonoise=\"on\"
    format=\"\"
    footer=\"$dollarntopics\"
    zeroresults=\"$dollarntopics\"
  }$percnt | $isodate | [[$wikiusername][$wikiname]] |"
  pager="on"
  pagesize="15"
}%

Test:
Searched: parent.name='WebHome'
Topic Children Modified By
CreateUserManually 0 2016-08-02T08:43:10Z KenU
CurrentSupportQuestions 0 2013-04-17T17:29:11Z LynnwoodBrown
Extensions 301 2016-03-01T16:57:10Z MichaelDaum
LdapGuiPlugin 0 2013-08-22T13:46:43Z RobertFelber
OpenIDLoginContrib 0 2016-12-06T16:01:30Z GeorgeClark
SocialFormfieldsPlugin 0 2014-09-18T10:54:36Z MichaelDaum
TestIt123 0 2016-10-25T21:49:47Z GeorgeClark
TestTopic0 0 2011-09-13T22:05:43Z LarsEik
TinyMCECleanStickyBitsPlugin 0 2010-07-11T13:13:22Z PaulHarvey
WebPreferences 2 2012-02-11T14:10:20Z PaulHarvey
WebStatistics 0 2017-03-25T01:59:37Z AdminUser
WebStatistics2008 0 2009-04-12T15:43:27Z ProjectContributor
WebStatistics2009 0 2009-04-12T15:43:27Z ProjectContributor
WebStatistics2010 0 2009-04-12T15:43:27Z ProjectContributor
WebStatistics2011 0 2009-04-12T15:43:27Z ProjectContributor
Number of topics: 15
Page 1 of 2 Next >

nesting with sectional INCLUDEs

IDEA! Requires INCLUDE macro

%SEARCH{
  "parent.name='WebHome'"
  type="query"
  pager="on"
  pagesize="15"
  header="| *Topic* | *Children* | *Modified* | *By* |"
  format="| [[$web.$topic][$topic]] | $percntINCLUDE{
      \"%TOPIC%\"
      section=\"children\"
      web=\"$web\"
      topic=\"$topic\"
    }$percnt \
    | $isodate | [[$wikiusername][$wikiname]] |"
}%

<verbatim class="foswikiHidden">%STARTSECTION{"children"}%%SEARCH{
  "parent.name='%topic%'"
  type="query"
  web="%web%"
  nonoise="on"
  format=""
  footer="$ntopics"
  zeroresults="$ntopics"
}%%ENDSECTION{"children"}%</verbatim>

Test:
Searched: parent.name='WebHome'
Topic Children Modified By
CreateUserManually   2016-08-02T08:43:10Z KenU
CurrentSupportQuestions   2013-04-17T17:29:11Z LynnwoodBrown
Extensions 301 2016-03-01T16:57:10Z MichaelDaum
LdapGuiPlugin   2013-08-22T13:46:43Z RobertFelber
OpenIDLoginContrib   2016-12-06T16:01:30Z GeorgeClark
SocialFormfieldsPlugin   2014-09-18T10:54:36Z MichaelDaum
TestIt123   2016-10-25T21:49:47Z GeorgeClark
TestTopic0   2011-09-13T22:05:43Z LarsEik
TinyMCECleanStickyBitsPlugin   2010-07-11T13:13:22Z PaulHarvey
WebPreferences 2 2012-02-11T14:10:20Z PaulHarvey
WebStatistics   2017-03-25T01:59:37Z AdminUser
WebStatistics2008   2009-04-12T15:43:27Z ProjectContributor
WebStatistics2009   2009-04-12T15:43:27Z ProjectContributor
WebStatistics2010   2009-04-12T15:43:27Z ProjectContributor
WebStatistics2011   2009-04-12T15:43:27Z ProjectContributor
Number of topics: 15
Page 1 of 2 Next >

-- PaulHarvey - 04 Aug 2011

Support.FAQForm edit

TopicClassification FrequentlyAskedQuestion
Subject Search
Topic Summary Explains a nested search
Extension
Interested Parties
Related Topics FormattedSearch
Topic revision: r3 - 10 Jan 2013, FernandoKejner - This page was cached on 25 Mar 2017 - 07:20.

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