| *Name* | *Type* | *Description* | | option1 | option | | | option2 | option | | | option3 | option | |How to extract the 'name' values, i.e. 'option1', 'option2' and 'option3' and put them in a HTML form select input?
%STARTSECTION{"solution1"}% <form> <select> %SEARCH{ "^\|[^\|]*\| *option *\|" topic="%TOPIC%" type="regex" multiple="on" nonoise="on" format="<option>$pattern(^\| *(.*?) *\|.*)</option>" }% </select> </form> %ENDSECTION{"solution1"}%Click to execute
| *Country* | | | | Afghanistan | | Aland Islands | | Albania | | Algeria | | American Samoa | | Andorra |You need to skip the header row. Use this search:
%STARTSECTION{"solution2"}% <select> %SEARCH{ "^\|[^\*\|]*\|" topic="CountryList" type="regex" multiple="on" nonoise="on" format="<option>$pattern(^\| *(.*?) *\|.*)</option>" }% </select> %ENDSECTION{"solution2"}%Click to execute
| a | b | c | d | e | | Marketing | b | c | d | e| | a | b | c | d | e | | a | marketing | c | d | e | | a | b | c | d | marketing |use this query:
%STARTSECTION{"solution3"}% %SEARCH{ "^\|.*?Marketing.*" type="regex" topic="%TOPIC%" multiple="on" nonoise="on" format="| $pattern(^\| *(.*?) *|.*)" }% %ENDSECTION{"solution3"}%Click to execute
%STARTSECTION{"solution4"}% %SEARCH{ "TopicClassification='%URLPARAM{"type" default="FrequentlyAskedQuestion"}%'" type="query" nonoise="on" sort="topic" format=" * [[$topic]] - <span class='foswikiGrayText'>$date, [[$wikiusername]]</span>" }% %ENDSECTION{"solution4"}%Click to execute The filtering select dialogue is created as in Pattern 1:
%STARTSECTION{"solution5"}% *Filter:* <form name="selectType" action="%SCRIPTURLPATH{"view"}%/%WEB%/" > <select name="type" size="1" onchange="document.location=this.value;"> %SEARCH{ "^\|[^\|]*\| *option *\|" topic="TopicClassification" type="regex" nonoise="on" format="<option value='%BASETOPIC%?type=$pattern(^\| *(.*?) *\|.*)'> $pattern(^\| *(.*?) *\|.*)</option>" }% <option value='%BASETOPIC%'>All pages</option> </select> </form> %ENDSECTION{"solution5"}%This will create similar functionality as Foswiki:Extensions.TopicClassificationAddOn Click to execute
%STARTSECTION{"solution6"}% Parent of [[%TOPIC%]] is [[%QUERY{ "parent.name" }%]] %ENDSECTION{"solution6"}%Click to execute
%STARTSECTION{"solution7"}% %SEARCH{ "parent.name='%HOMETOPIC%'" type="query" nonoise="on" header="*Children:* " format="[[$topic]]" separator=", " }% %ENDSECTION{"solution7"}%Click to execute See also HierarchicalNavigation for an elaborate example.
%STARTSECTION{"solution8"}% <form> <select name="topic"> <option value="%TOPIC%">Select...</option> %SEARCH{ "%HOMETOPIC%" scope="topic" web="all" topic="%HOMETOPIC%" format="<option value='$web.$topic'>$web</option>" separator=" " }% </select> <input type="submit" class="foswikiSubmit" value="Go" /> </form> %ENDSECTION{"solution8"}%Public webs can be found with the %WEBLIST% macro. Click to execute
%STARTSECTION{"solution9"}% <select name="type"> <option>Select category...</option> %SEARCH{ " *\s*.*?" topic="CategoryList" type="regex" multiple="on" casesensitive="on" nonoise="on" format="<option>$pattern(.* \*\s*([^\n]*).*)</option>" }% </select> %ENDSECTION{"solution9"}%Click to execute To render the bullet list as a comma-separated list, use the
separator
parameter:
%STARTSECTION{"solution10"}% %SEARCH{ " *\s*.*?" topic="CategoryList" type="regex" multiple="on" casesensitive="on" nonoise="on" separator="," format="$pattern(.* \*\s*([^\n]*).*)" }% %ENDSECTION{"solution10"}%Click to execute
%STARTSECTION{"solution11"}% *Moved topics*: %SEARCH{ "moved.from=~'\w+'" web="all" type="query" separator=", " format="[[$web.$topic]]" nonoise="on" }% %ENDSECTION{"solution11"}%Click to execute
$pattern()
token.
%STARTSECTION{"solution12"}% %SEARCH{ "^---[+][^+][^\r\n]+[\r\n]" type="regex" nonoise="on" header="Headings:" limit="5" format=" * [[$topic][$pattern([\r\n\-+!]+([^\r\n]*?)[\r\n].*)]]" footer="Found $ntopics topics with level-1 headings" }% %ENDSECTION{"solution12"}%Click to execute
%STARTSECTION{"click2exec"}% %BUTTON{"Click to execute" onclick="jQuery('#%id%').trigger('refresh')"}% <div class="jqLoader" data-mode="manual" data-web="%INCLUDINGWEB%" data-topic="%INCLUDINGTOPIC%" data-section="%id%" id="%id%"></div> %JQREQUIRE{"loader"}% %ENDSECTION{"click2exec"}%
![]() |
© 2025 D.Soost & D.Marxsen - All rights reserved © Of all articles by authors Trademarks are the property of their respective owners © Logo by Wikipedia, modified by Administrator | Impressum Disclaimer Datenschutzerklärung |