--- /dev/null
+**Include Topics and Web Pages Using <code>**%INCLUDE\{...\}%**</code> Variable**
+
+Use the <code>**%INCLUDE\{...\}%**</code> variable to embed the content of another topic or web page inside a %WIKITOOLNAME% topic. The whole content or only parts of a page can be included.
+
+<div>
+ <ul>
+ <li><a href="#Syntax"> Syntax</a></li>
+ <li><a href="#Usage Examples"> Usage Examples</a><ul>
+ <li><a href="#1. Display regression test resul"> 1. Display regression test results in a TWiki page</a></li>
+ <li><a href="#2. Display Yahoo's robot.txt fil"> 2. Display Yahoo's robot.txt file</a></li>
+ <li><a href="#3. Display the SUNW stock quote"> 3. Display the SUNW stock quote in a TWiki page</a></li>
+ <li><a href="#4. Display the temperature in Sa"> 4. Display the temperature in San Francisco</a></li>
+ </ul>
+ </li>
+ </ul>
+</div>
+
+## <a name="Syntax"></a> Syntax
+
+<code>**%INCLUDE\{"page" pattern="reg-exp"\}%**</code>
+
+- <code>**"page"**</code>: <br /> The nameless parameter specifies the page to include. It is
+ - The name of a topic located in the current web, i.e. <code>**%INCLUDE\{"WebNotify"\}%**</code>
+ - A `Web.Topic` name specifying a topic in another web, i.e. <code>**%INCLUDE\{"TWiki.TWikiWebsTable"\}%**</code>
+ - A full qualified URL with <code>**http**</code> protocol, domain name and optional port number, i.e. <code>**%INCLUDE\{"http://twiki.org:80/index.html"\}%**</code>. Supported content types are <code>**text/html**</code> and <code>**text/plain**</code>. The full page is included by default, but the HTML header and scripts are stripped in case it is a web page.
+
+- <code>**pattern="reg-exp"**</code>: <br /> The **pattern** parameter is optional and allows you to extract some parts of a web page. Specify a [[RegularExpression]] that scans from start (`'^'`) to end and contains the text you want to keep in parenthesis, i.e. <code>**pattern="^.\*?(from here.\*?to here).\*"**</code>. You need to make sure that the integrity of a web page is not compromised, i.e. if you include a table make sure to include everything including the table end tag.
+
+**_Note:_** All text of a topic is included unless you specify <code>**%STARTINCLUDE%**</code>, <code>**%STOPINCLUDE%**</code> and/or a **pattern** parameter.
+
+## <a name="Usage Examples"></a> Usage Examples
+
+### <a name="1. Display regression test resul"></a> 1. Display regression test results in a TWiki page
+
+ <pre>
+ %INCLUDEURL{"http://domain/~qa/v1.1/REDTest.log.txt"}%
+ </pre>
+
+### <a name="2. Display Yahoo's robot.txt fil"></a> 2. Display Yahoo's robot.txt file
+
+- You type:
+ - <code>**%INCLUDE\{"http://www.yahoo.com/robots.txt"\}%**</code><br />
+- You get:
+
+ %INCLUDE{"http://www.yahoo.com/robots.txt"}%
+
+### <a name="3. Display the SUNW stock quote"></a><a name="3. Display the SUNW stock quote "></a> 3. Display the SUNW stock quote in a TWiki page
+
+- You type:
+ - <code>**SUNW: %INCLUDE\{"http://finance.yahoo.com/q?s=SUNW&d=v1&o=t" pattern="^.\*?>SUNW</a>[^<]+(.\*?)\\s+\\S+\\s+<small.\*"\}%**</code><br />
+- You get:
+ - SUNW:
+
+### <a name="4. Display the temperature in Sa"></a> 4. Display the temperature in San Francisco
+
+- You type:
+ - <code>**San Francisco: %INCLUDE\{"http://weather.yahoo.com/forecast/San\_Francisco\_CA\_US\_f.html" pattern="^.\*?([0-9]+\\&ordm\\;F).\*"\}%**</code><br />
+- You get:
+ - San Francisco:
+
+See also other [[TWikiVariables]].
+
+-- [[PeterThoeny]] - 25 Jun 2001 <br />
- Vertical size of text edit box: (can be overwritten by user preferences)
- Set EDITBOXHEIGHT = 15
-- Default state of the **_link_** check box in the attach file page. Check box is initially checked if _Set ATTACHLINKBOX = CHECKED_ , unchecked if empty ( _Set ATTACHLINKBOX =_ ). If checked, a link is created to the attached file at the end of the topic: (can be overwritten by user preferences)
+- Default state of the **_Release edit lock_** check box in preview. Checkbox is initially checked if `Set RELEASEEDITLOCKCHECKBOX = checked="checked"`, or unchecked if empty. If checked, make sure to click on <u>Edit</u> to do more changes; do **not** go back in your browser to the edit page, or you risk that someone else will edit the topic at the same time: (can be overwritten by user preferences)
+ - Set RELEASEEDITLOCKCHECKBOX =
+
+- Default state of the **_link_** check box in the attach file page. Checkbox is initially checked if `Set ATTACHLINKBOX = checked="checked"`, or unchecked if empty (`Set ATTACHLINKBOX =`). If checked, a link is created to the attached file at the end of the topic: (can be overwritten by user preferences)
- Set ATTACHLINKBOX =
- Wiki webmaster email address:
- Set WIKIWEBMASTER = <webmaster@your.company>
-- Mail host for outgoing mail. This is used for [[TWikiNotificationOfChanges]] if Perl module <code>**Net::SMTP**</code> is installed. If not, sendmail is used instead (defined by <code>**$mailProgram**</code> in <code>**TWiki.cfg**</code>). Examples: mail.your.company, localhost
+- Mail host for outgoing mail. This is used for [[TWikiNotificationOfChanges]] if Perl module <code>**Net::SMTP**</code> is installed. If not, sendmail is used instead (defined by <code>**$mailProgram**</code> in <code>**TWiki.cfg**</code>). Examples: `mail.your.company` or `localhost`
- Set SMTPMAILHOST = mail
- http-equiv meta tags for **_view_**, **_rdiff_**, **_attach_**, **_search\*_** scripts:
- - Set HTTP\_EQUIV\_ON\_VIEW =
+
+ * Set HTTP_EQUIV_ON_VIEW =
- http-equiv meta tags for **_edit_** script. Example to expire immediately: <br />`Set HTTP_EQUIV_ON_EDIT = <meta http-equiv="Expires" content="%GMTIME{"$day $month, $year - $hour:$min:$sec"}% GMT">`
- - Set HTTP\_EQUIV\_ON\_EDIT =
+
+ * Set HTTP_EQUIV_ON_EDIT =
- http-equiv meta tags for **_preview_** script:
- - Set HTTP\_EQUIV\_ON\_PREVIEW =
+
+ * Set HTTP_EQUIV_ON_PREVIEW =
- Users or groups allowed to change this %TOPIC% topic: (I.e. [[TWikiAdminGroup]])
- Set ALLOWTOPICCHANGE =
<td> 2 digit year </td>
<td> 99 </td>
</tr>
- </table> Variables can be shortened to 3 characters. Example: <br /><code>%GMTIME{"$day $month, $year - $hour:$min:$sec"}%</code> is <br /><b>29 Jun, 2010 - 15:26:32</b></td>
+ </table> Variables can be shortened to 3 characters. Example: <br /><code>%GMTIME{"$day $month, $year - $hour:$min:$sec"}%</code> is <br /><b>29 Jun, 2010 - 15:26:37</b></td>
</tr>
<tr>
<td><code>%SERVERTIME%</code></td>
<td> REMOTE_USER environment variable, is <b></b></td>
</tr>
<tr>
- <td><code>%INCLUDE{"SomeTopic"}%</code></td>
- <td> Server side include, includes another topic. The current Wiki web is searched by default. Example: <code><b>%INCLUDE{"TWiki.TWikiWebsTable"}%</b></code></td>
+ <td><code>%INCLUDE{"page" ...}%</code></td>
+ <td> Server side include to [[Main/IncludeTopicsAndWebPages]]. The parameter is composed of the page name, followed by an optional <code>pattern="(reg-exp)"</code> pair. The page name is: <table border="1" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><code>"SomeTopic"</code></td>
+ <td> The name of a topic located in the current web, i.e. <code>%INCLUDE{"WebNotify"}%</code></td>
+ </tr>
+ <tr>
+ <td><code>"Web.Topic"</code></td>
+ <td> A topic in another web, i.e. <code>%INCLUDE{"TWiki.TWikiWebsTable"}%</code></td>
+ </tr>
+ <tr>
+ <td><code>"http://..."</code></td>
+ <td> A full qualified URL, i.e. <code>%INCLUDE{"http://twiki.org/"}%</code></td>
+ </tr>
+ </table>
+ </td>
</tr>
<tr>
<td><code>%STARTINCLUDE%</code></td>
</tr>
<tr>
<td><code>web="Name"</code><br /><code>web="Main Know"</code><br /><code>web="all"</code></td>
- <td> Wiki web to search: A web, a list of webs separated by whitespace, or all webs <code>[2]</code></td>
+ <td> Wiki web to search: A web, a list of webs separated by whitespace, or <code>all</code> webs. [2] </td>
<td> Current web </td>
</tr>
<tr>
- Additional preferences variables can be defined on all three level as needed. Example:
- `Set MYLOGO = %PUBURLPATH%/%MAINWEB%/LogoTopic/logo.gif`
--- [[PeterThoeny]] - 24 Mar 2001 <br />
+-- [[PeterThoeny]] - 25 Jun 2001 <br />