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
--
PaulVeuve - 28 Jan 2007
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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