diff options
author | MikeMannix <MikeMannix> | 2001-11-23 11:33:33 +0000 |
---|---|---|
committer | MikeMannix <MikeMannix> | 2001-11-23 11:33:33 +0000 |
commit | cbbbab851de84dc2291cd3f81ffb45e284d3dd98 (patch) | |
tree | 1be4cb149a3feea397f1c47256c668d2b7433b2e /TWiki/TWikiVariablesExamples.mdwn | |
parent | ad3f49f46b06c1711adfb79cfe3c3823c2f96230 (diff) |
none
Diffstat (limited to 'TWiki/TWikiVariablesExamples.mdwn')
-rw-r--r-- | TWiki/TWikiVariablesExamples.mdwn | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/TWiki/TWikiVariablesExamples.mdwn b/TWiki/TWikiVariablesExamples.mdwn new file mode 100644 index 00000000..7ffc8165 --- /dev/null +++ b/TWiki/TWikiVariablesExamples.mdwn @@ -0,0 +1,62 @@ +%TOC\{depth="4"\}% %STARTINCLUDE% + +# <a name="TWikiVariables_Examples"> TWikiVariables Examples </a> + +## <a name="Bullet_list_showing_topic_name_a"> Bullet list showing topic name and summary </a> + +**Write this:** + +<code>%SEARCH\{ "FAQ" scope="topic" web="TWiki" nosearch="on" nototal="on" header=" \* \*Topic: Summary:\*" format=" \* [[$web.$topic]]: $summary" \}%</code> + +**To get this:** + +%SEARCH\{ "FAQ" scope="topic" web="TWiki" nosearch="on" nototal="on" header=" \* \*Topic: Summary:\*" format=" \* [[Webtopic]]: $summary" \}% + +## <a name="Table_with_form_field_values_of_"> Table with form field values of topics with a form </a> + +**Write this:** + +<code>| \*Topic:\* | \*OperatingSystem:\* | \*OsVersion:\* |</code><br /><code>%SEARCH\{ "[T]opicClassification.\*?value=\\"[P]ublicFAQ\\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield([[OperatingSystem]]) | $formfield([[OsVersion]]) |" \}%</code> + +**To get this:** _(simulated)_ + +<table border="1" cellpadding="1" cellspacing="0"> + <tr> + <th bgcolor="#99CCCC"><strong>Topic:</strong></th> + <th bgcolor="#99CCCC"><strong>OperatingSystem:</strong></th> + <th bgcolor="#99CCCC"><strong>OsVersion:</strong></th> + </tr> + <tr> + <td><a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/Know/IncorrectDllVersionW32PTH10DLL">IncorrectDllVersionW32PTH10DLL</a></td> + <td><a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/Know/OsWin">OsWin</a></td> + <td> 95/98 </td> + </tr> + <tr> + <td><a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/Know/WinDoze95Crash">WinDoze95Crash</a></td> + <td><a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/Know/OsWin">OsWin</a></td> + <td> 95 </td> + </tr> +</table> + +## <a name="Extract_text_from_a_topic_using_"> Extract text from a topic using regular expressions </a> + +**Write this:** + +<code>%SEARCH\{ "\_\_Back to\\:\_\_ TWikiFAQ" scope="text" web="TWiki" regex="on" nosearch="on" nototal="on" header="TWiki FAQs:" format=" \* $pattern(.\*?FAQ\\:[\\n\\r]\*([^\\n\\r]+).\*) [[$web.$topic]\[Answer...]]" \}%</code> + +**To get this:** + +%SEARCH\{ "\_\_Back to\\:\_\_ [[TWikiFAQ]]" scope="text" web="TWiki" regex="on" nosearch="on" nototal="on" header="TWiki FAQs:" format=" \* $pattern(.\*?FAQ\\:[\\n\\r]\*([^\\n\\r]+).\*) [[Webtopic]]" \}% + +## <a name="Creating_Custom_Variables"> Creating Custom Variables </a> + +* You can add your own preference variables for an entire site, a single web, or a single topic, using the standard syntax. Whatever you include in your variable will be expanded on display, and treated exactly as if it had been written out. So you can place formatted text, page links, image paths. + +> **Example: Create a custom logo variable** +> +> <br /> +> +> * To place a logo anywhere in a web by typing <code>**%MYLOGO%**</code>, simply define the variable on the web's [[WebPreferences]] page. You also have to upload `logo.gif` - this can be done by [[FileAttachment]] to `LogoTopic` (any topic name you choose): +> * <code>**Set MYLOGO = %PUBURL%/%MAINWEB%/LogoTopic/logo.gif**</code> + +-- [[Main/MikeMannix]] - 23 Nov 2001 |