Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Search Pattern CookbookThe Search function in TWiki is very powerful. Especially searches using a RegularExpression play an important part of tapping TWiki's full potential. Unfortunately RegularExpressions can be incredibly obscure to the uninitiated. | ||||||||
Line: 85 to 85 | ||||||||
This will create similar functionality as TWiki:Plugins.TopicClassificationAddOn![]() | ||||||||
Changed: | ||||||||
< < | Pattern 3a: listbox with all user names | |||||||
> > | Pattern 3: Creating lists of TWiki usernames | |||||||
ProblemHow to populate a list box with all usernames of registered TWiki users | ||||||||
Changed: | ||||||||
< < | Solution | |||||||
> > | Solution 1: Appropriate for Sep 2004 TWiki (Cairo) | |||||||
<form name="testing" action="%SCRIPTURLPATH{"view"}%/%MAINWEB%" method="get"> | ||||||||
Line: 115 to 115 | ||||||||
This searches all topics in the Main web that contain "Name", "Email" and "Country" bullets. Alternatively, do a FormattedSearch with multiple="on" on the Main.TWikiUsers topic. | ||||||||
Changed: | ||||||||
< < | Pattern 3b: listbox with all user names - select multiple namesProblemSuppose you want to send mail from a form on topic page to a selected list of multiple TWikiUsersSolutionThe example of Pattern 3a produces the list box. Add a MULTIPLE to the select statement, i.e.: | |||||||
> > | Solution 2: As Solution 1, but with possibility for multi-selecting usernamesThe example of Solution 1 produces the list box. Add a MULTIPLE to the select statement, i.e.: | |||||||
<select name="topic" size="2" MULTIPLE> | ||||||||
Changed: | ||||||||
< < | Please note that the Search pattern is unchanged compared to Pattern 3a. The change is in the HTML form element. | |||||||
> > | Please note that the Search pattern is unchanged compared to Solution 1. The change is in the HTML form element. | |||||||
Changed: | ||||||||
< < | Test caseThe Search pattern 3a with the abovementioned modification is, in effect: | |||||||
> > | The abovementioned modification is, in effect: | |||||||
Line: 139 to 132 | ||||||||
Added: | ||||||||
> > | Solution 3: Appropriate for TWiki 4 (Dakar)When the User information is stored in a UserForm (as is default in Dakar) then this list can be generated as follows:<form name="testing" action="%SCRIPTURLPATH{"view"}%/%MAINWEB%" method="get"> <select name="topic"> <option>Select user...</option> %SEARCH{"%META:FORM.*[U]serForm" web="%MAINWEB%" regex="on" casesensitive="on" nosearch="on" format="<option>$topic</option>" sort="topic" excludetopic="Test*, TWiki*"}% </select> <input type="submit" value="Go" /> </form>In the above example:
| |||||||
Pattern 4: Extract the parent of a given topic |