| *Name* | *Type* | *Tooltip message* | | 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?
<form>
<select>
%SEARCH{ "^\|[^\|]*\| *option *\|" topic="%TOPIC%" type="regex" multiple="on" nosearch="on" nototal="on" format="<option>$pattern(^\| *(.*?) *\|.*)</option>" }%
</select>
</form>
which is, in effect:
Image a form with two fields:
%SEARCH{"TopicClassification='%URLPARAM{type}%'" type="query" nosearch="on"
format=" * $topic - <font face=\"arial,helvetica\" size=\"1\">
_last modified by_ $wikiusername _on_ $date </font> %BR%
<font face=\"arial,helvetica\" size=\"1\"> $formfield(TopicStatus) </font>"
sort="topic"}%
The filtering select dialogue is created as in Pattern 1:
%STARTSIDEBAR%
*Filter:* %BR%
<form name="selectType" action="%SCRIPTURLPATH{"view"}%/%WEB%/" >
<select name="type" size="1" onchange="document.location=this.value;">
%SEARCH{ "^\|[^\|]*\| *option *\|" topic="TopicClassification" web="%WEB%" type="regex"
multiple="on" nosearch="on" nototal="on" format="<option value=%BASETOPIC%?type=$pattern(^\| *(.*?) *\|.*)>$pattern(^\| *(.*?) *\|.*)</option>" }%
<option value=%BASETOPIC%>All pages</option> </select>
</form>
%STOPSIDEBAR%
This will create similar functionality as Foswiki:Extensions.TopicClassificationAddOn
%META{ "parent" dontrecurse="on" }%
Children:
%SEARCH{ "parent.name='%TOPIC%'" type="query" nonoise="on" format="[[$topic]]" separator=", " }%
Note: Replace %TOPIC% with %BASETOPIC% if you put this SEARCH into the skin or a sidebar.
<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" value="Go" />
</form>
<select name="type">
<option>Select category...</option>
%SEARCH{" *\s*.*?" topic="CategoryList" type="regex" multiple="on" casesensitive="on" nosummary="on" nosearch="on" noheader="on" nototal="on" format="<option>$pattern(.* \*\s*([^\n]*).*)</option>"}%
</select>
To render the bullet list as a comma-separated list, use the separator parameter:
%SEARCH{" *\s*.*?" topic="CategoryList" type="regex" multiple="on" casesensitive="on" nosummary="on" nosearch="on" noheader="on" nototal="on" separator="," format="$pattern(.* \*\s*([^\n]*).*)"}%
Name: entry.
%SEARCH{" * [N]ame: " topic="%TOPIC%" type="regex" casesensitive="on" nosummary="on" nosearch="on" noheader="on" nototal="on" format="---+!! $pattern(.* \* Name: ([^\n]*).*)"}%
Moved topics: %SEARCH{ "moved.to!=''" type="query" format="$topic, " nosearch="on" noheader="on" nosummary="on" }%
Copyright © by the contributing authors. All material on this site is the property of the contributing authors.