adff4b5ab85498f1f4209ff6504f20d5e1050070
[openafs-wiki.git] / TWiki / VarINCLUDE.mdwn
1 <a name="VarINCLUDE"></a>
2
3 ### <a name="INCLUDE{&quot;page&quot;} -- include other"></a> INCLUDE\{"page"\} -- include other topic or web page
4
5 - Syntax: `%INCLUDE{"page" ...}%`
6 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
7   <tr>
8     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
9     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
10     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
11   </tr>
12   <tr>
13     <td><code>"SomeTopic"</code></td>
14     <td> The name of a topic located in the current web, i.e. <code>%INCLUDE{"WebNotify"}%</code></td>
15     <td>   </td>
16   </tr>
17   <tr>
18     <td><code>"Web.Topic"</code></td>
19     <td> A topic in another web, i.e. <code>%INCLUDE{"%SYSTEMWEB%.SiteMap"}%</code></td>
20     <td>   </td>
21   </tr>
22   <tr>
23     <td><code>"http://..."</code></td>
24     <td> A full qualified URL, i.e. <code>%INCLUDE{"http://twiki.org:80/index.html"}%</code>. Supported content types are <code>text/html</code> and <code>text/plain</code>. <br /> %I% if the URL resolves to an attachment file on the server this will <em>automatically</em> translate to a server-side include. </td>
25     <td>   </td>
26   </tr>
27   <tr>
28     <td><code>pattern="..."</code></td>
29     <td> Include a subset of a topic or a web page. Specify a [[Main/RegularExpression]] that scans from start (<code>'^'</code>) to end and contains the text you want to keep in parenthesis, e.g., <code>pattern="^.*?(from here.*?to here).*"</code>. [[Main/IncludeTopicsAndWebPages]] has more. </td>
30     <td> none </td>
31   </tr>
32   <tr>
33     <td><code>rev="2"</code></td>
34     <td> Include a previous topic revision; N/A for URLs </td>
35     <td> top revision </td>
36   </tr>
37   <tr>
38     <td><code>raw="on"</code></td>
39     <td> When a page is included, normally %WIKITOOLNAME% will process it, doing the following: 1) Alter relative links to point back to originating host, 2) Remove some basic HTML tags (html, head, body, script) and finally 3) Remove newlines from HTML tags spanning multiple lines. If you prefer to include <em>exactly</em> what is in the source of the originating page set this to <code>on</code>. %BR% <code>raw="on"</code> is short for <code>disableremoveheaders="on"</code>, <code>disableremovescript="on"</code>, <code>disableremovebody="on"</code>, <code>disablecompresstags="on"</code> and <code>disablerewriteurls="on"</code>. </td>
40     <td> disabled </td>
41   </tr>
42   <tr>
43     <td><code>literal="on"</code></td>
44     <td> While using the <code>raw</code> option will indeed include the raw content, the included content will still be processed and rendered like regular topic content. To disable parsing of the included content, set the <code>literal</code> option to <code>"on"</code>. </td>
45     <td> disabled </td>
46   </tr>
47   <tr>
48     <td><code>disableremoveheaders="on"</code></td>
49     <td> Bypass stripping headers from included HTML (everything until first <code>&lt;/head&gt;</code> tag) </td>
50     <td> disabled </td>
51   </tr>
52   <tr>
53     <td><code>disableremovescript="on"</code></td>
54     <td> Bypass stripping all <code>&lt;script&gt;</code> tags from included HTML </td>
55     <td> disabled </td>
56   </tr>
57   <tr>
58     <td><code>disableremovebody="on"</code></td>
59     <td> Bypass stripping the <code>&lt;/body&gt;</code> tag and everything around over and below it </td>
60     <td> disabled </td>
61   </tr>
62   <tr>
63     <td><code>disablecompresstags="on"</code></td>
64     <td> Bypass replacing newlines in HTML tags with spaces. This compression step rewrites unmatched &lt;'s into <code>&amp;lt;</code> entities unless bypassed </td>
65     <td> disabled </td>
66   </tr>
67   <tr>
68     <td><code>disablerewriteurls="on"</code></td>
69     <td> Bypass rewriting relative URLs into absolute ones </td>
70     <td> disabled </td>
71   </tr>
72   <tr>
73     <td><code>warn="off"</code></td>
74     <td> Warn if topic include fails: Fail silently (if <code>off</code>); output default warning (if set to <code>on</code>); else, output specific text (use <code>$topic</code> for topic name) </td>
75     <td><code>%INCLUDEWARNING%</code> [[Main/TWikiPreferences]] setting </td>
76   </tr>
77   <tr>
78     <td><code>section="name"</code></td>
79     <td> Includes only the specified named section, as defined in the included topic by the [[Main/VarSTARTSECTION]] and [[Main/VarENDSECTION]] variables. Nothing is shown if the named section does not exists. <code>section=""</code> is equivalent to not specifying a section </td>
80     <td>   </td>
81   </tr>
82   <tr>
83     <td><code>PARONE="val 1"%BR% PARTWO="val 2"</code></td>
84     <td> Any other parameter will be defined as a variable within the scope of the included topic. The example parameters on the left will result in <code>%PARONE%</code> and <code>%PARTWO%</code> being defined within the included topic. </td>
85     <td>   </td>
86   </tr>
87 </table>
88 - **_Note:_** JavaScript in included webpages is filtered out as a security precaution per default (disable filter with `disableremovescript` parameter)
89 - Examples: See [[IncludeTopicsAndWebPages]]
90 - Related: [[BASETOPIC|Main/VarBASETOPIC]], [[BASEWEB|Main/VarBASEWEB]], [[INCLUDINGTOPIC|Main/VarINCLUDINGTOPIC]], [[INCLUDINGWEB|Main/VarINCLUDINGWEB]], [[STARTINCLUDE|Main/VarSTARTINCLUDE]], [[STOPINCLUDE|Main/VarSTOPINCLUDE]], [[STARTSECTION|Main/VarSTARTSECTION]], [[ENDSECTION|Main/VarENDSECTION]]