1 <a name="VarURLPARAM"></a>
3 ### <a name="URLPARAM{"name"} -- get value of"></a> URLPARAM\{"name"\} -- get value of a URL parameter
5 - Returns the value of a URL parameter.
6 - Syntax: `%URLPARAM{"name"}%`
7 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
9 <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
10 <th bgcolor="#99CCCC"><strong> Description: </strong></th>
11 <th bgcolor="#99CCCC"><strong> Default: </strong></th>
14 <td><code>"name"</code></td>
15 <td> The name of a URL parameter </td>
19 <td><code>default="..."</code></td>
20 <td> Default value in case parameter is empty or missing </td>
21 <td> empty string </td>
24 <td><code>newline="<br />"</code></td>
25 <td> Convert newlines in textarea to other delimiters </td>
26 <td> no conversion </td>
29 <td><code>encode="entity"</code></td>
30 <td> Encode special characters into HTML entities. See [[Main/WebHome#VarENCODE]] for more details. </td>
31 <td> no encoding </td>
34 <td><code>encode="url"</code></td>
35 <td> Encode special characters for URL parameter use, like a double quote into <code>%22</code></td>
36 <td> no encoding </td>
39 <td><code>encode="quote"</code></td>
40 <td> Escape double quotes with backslashes (<code>\"</code>), does not change other characters; required when feeding URL parameters into other TWiki variables </td>
41 <td> no encoding </td>
44 <td><code>multiple="on"</code> %BR% <code>multiple="[[$item]]"</code></td>
45 <td> If set, gets all selected elements of a <code><select multiple="multiple"></code> tag. A format can be specified, with <code>$item</code> indicating the element, e.g. <code>multiple="Option: $item"</code></td>
46 <td> first element </td>
49 <td><code>separator=", "</code></td>
50 <td> Separator between multiple selections. Only relevant if multiple is specified </td>
51 <td><code>"\n"</code> (new line) </td>
54 - Example: `%URLPARAM{"skin"}%` returns `print` for a `.../view/%WEB%/%INCLUDINGTOPIC%?skin=print` URL
55 - **_%X% Note:_** URL parameters passed into HTML form fields must be entity [[ENCODEd|Main/WebHome#VarENCODE]].
56 - **_%X% Note:_** Double quotes in URL parameters must be escaped when passed into other TWiki variables.%BR% Example: `%SEARCH{ "%URLPARAM{ "search" encode="quotes" }%" noheader="on" }%`
57 - **_%X% Note:_** When used in a template topic, this variable will be expanded when the template is used to create a new topic. See [[TWikiTemplates#TemplateTopicsVars]] for details.
58 - **_%X% Note:_** There is a risk that this variable could be misused for cross-site scripting.
59 - Related: [[ENCODE|Main/WebHome#VarENCODE]], [[SEARCH|Main/WebHome#VarSEARCH]], [[FormattedSearch]], [[QUERYSTRING|Main/WebHome#VarQUERYSTRING]]