Tags:
create new tag
view all tags

Question

What is the way to extract in a list all childs of a topic by displaying the first titel as link to the topic

Topic LibSoft:

---+!! LIB - SOFT
---++ CHILDS
%INCLUDE{ "TemplateChildsTitel" }%
....

Child LibSoftCs:

---+!! LIB - SOFT - CS
....

Child LibSoftCpp:

---+!! LIB - SOFT - CPP
....

Expected result in LibSoft Topic:
LIB - SOFT CHILDS

  • LIB - SOFT - CS
  • LIB - SOFT - CPP

The childs my be diplayed with:

%METASEARCH{type="parent" web="%WEB%" topic="%TOPIC%" }% 

The titel my be extracted with something like:

%SEARCH{ "^"
                     scope="topic"
                     regex="on" nosearch="on" nototal="on" order="modified" reverse="on" limit="100"
                     format="   * [[$web.$topic][$pattern(^---\+[\s!]*([^\n\r]+).*)]]" }%

How to put all together and in a template to be included

Environment

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

-- PaulVeuve - 28 Jan 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

You can just make a formatted METASEARCH :

%METASEARCH{type="parent" web="%INCLUDINGWEB%" topic="%INCLUDINGTOPIC%" format="   * [[$web.$topic][$pattern(^---\+[\s!]*([^\n\r]+).*)]]"}%

Put that in a seperate topic (with %STARTINCLUDE% etc around it) and then you can just include the topic wherever you want

I was curious about your SEARCH, but it seems that if the first heading in a topic is a level 2 heading, then the search will return '+ title heading 2'. Don't know how to fix it, just wanted to let you know... (If you find out how to do that, please post it here)

-- JosMaccabiani - 28 Jan 2007

Hello, Thank's for the information, but format has no effect and there is no "format" parameters listed in METASEARCH description.

-- PaulVeuve - 16 Feb 2007

You need to upgrade to 4.1.2 to get the format option working in METASEARCH

-- YogiParish - 19 Mar 2007

Change status to:
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2007-05-08 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.