|
META TOPICPARENT |
name="TWikiVariables" |
|
|
< < | INCLUDE{"page"} -- include other topic or web page |
> > | INCLUDE{"page"} -- include other topic, attachment, or web page |
|
- Merges the content of a specified page into the current one before rendering.
- Syntax:
%INCLUDE{"page" ...}%
- Supported parameters:
|
|
"SomeTopic" |
The name of a topic located in the current web, i.e. %INCLUDE{"WebNotify"}% |
|
"Web.Topic" |
A topic in another web, i.e. %INCLUDE{"TWiki.SiteMap"}% |
|
"http://..." |
A full qualified URL, i.e. %INCLUDE{"http://twiki.org:80/index.html"}% . Supported content types are text/html and text/plain by default. See allowanytype . if the URL resolves to an attachment file on the server this will automatically translate to a server-side include. |
|
|
|
> > |
attachment="filename.ext" |
Include the specified attachment instead of topic text. The attachment content is subject to processing just like when topic text is included. For example, text up to %STARTINCLUDE% is excluded. When including an attachment, you can do without topic specification - %INCLUDE{attachment="filename.ext"}% works, which results in including the attachment of the same topic. |
|
|
|
allowanytype="on" |
Suppress the content type checking in including the web page specified by a URL. |
disabled |
|
|
> > |
charset="CHARSET" |
Specify the charset of the included content so that a proper charset conversion happens when it's different from the site charset. Needless to say, this works for a TWiki topic, a topic attachment, and a content specified with a URL. This parameter overrides otherwise specified or implied charset. |
none |
|
|
pattern="..." |
Include a subset of a topic or a web page. Specify a RegularExpression that scans from start ('^' ) to end and contains the text you want to keep in parenthesis, e.g., pattern="^.*?(from here.*?to here).*" . IncludeTopicsAndWebPages has more. |
none |
headingoffset="2" |
Adjust the level of headings in the included topic. A "2" or "+2" increases the level by two, e.g. a ---+ H1 turns into a ---+++ H3. Positive and negative values are supported. Adjusted min and max levels are H1 and H6, respectively. |
no adjustment |
hidetoc="on" |
Remove %TOC% in included content. Useful to show table of contents in individual topics, while suppressing them if included in a big master document. |
TOC_HIDE_IF_ INCLUDED setting |
rev="2" |
Include a previous topic revision; N/A for URLs |
top revision |
raw="on" (for HTTP inclusion) |
When a page is included via HTTP, normally TWiki 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 exactly what is in the source of the originating page set this to on . raw="on" is short for disableremoveheaders="on" , disableremovescript="on" , disableremovebody="on" , disablecompresstags="on" and disablerewriteurls="on" . |
disabled |
|
|
< < |
raw="on" (for topic inclusion) |
When a topic is included, normally TWiki variables in the included topic are expanded in the context of the inlcluded topic. If raw="on" is specified, that variable expansion does not happen. You may wonder what's that for and what are the implications, which are found out on IncludeTopicRaw. Because of the "in the raw" nature of the parapmeter, if it's specified, parameters such as encode , headingoffset , hidetoc , newline , nofinalnewline , and section are ignored. |
disabled |
|
> > |
raw="on" (for topic or attachment inclusion) |
When a topic is included, normally TWiki variables in the included topic are expanded in the context of the inlcluded topic. If raw="on" is specified, that variable expansion does not happen. You may wonder what's that for and what are the implications, which are found out on IncludeTopicRaw. Because of the "in the raw" nature of the parapmeter, if it's specified, parameters such as encode , headingoffset , hidetoc , newline , nofinalnewline , and section are ignored. |
disabled |
|
|
literal="on" |
While using the raw 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 literal option to "on" . |
disabled |
nofinalnewline="on" |
Delete the new line at the end of the result if exists |
disabled |
newline="$br" |
Convert newlines in textarea to other delimiters. Variable $br expands to <br /> tag, and $n to a newline. Other text is encoded based on encode parameter. |
no conversion |
|
|
- Security Considerations:
- The ability to INCLUDE arbitrary URLs, such as
%INCLUDE{"http://www.google.com/"}% is turned off by default. To turn this on, ask your TWiki administrator to enable the {INCLUDE}{AllowURLs} flag in the Security setup section of configure.
- JavaScript in included web pages is filtered out as a security precaution per default. Disable filtering with
raw or disableremovescript parameter.
|
|
> > |
- Infinite INCLUDE loop prevention:
- INCLUDE attachment:
As described above, there are two ways to include an attachment. They are similar, but behave slightly differently.
-
attachment="filename.ext" This works in the same manner as ordinary topic text inclusion. %STARTINCLUDE% and %STOPINCLUDE% in the attachment are observed. The section parameter is observed. The variables are expanded in the context of the topic having the attachment. For example, %TOPIC% is expanded to the name of the topic having the attachment.
- Specifying the URL of an attachment. (e.g.
%INCLUDE{%ATTACHURL%/foo.txt}% ) The attachment content is processed in the same manner as when data is retrieved from another web server. Unless raw="on" is specified, the content of <body>...</body> is extracted, all occurrences of <script>...</script> are removed. Topic context change doesn't happen because in general inclusion via HTTP doesn't cause topic context change.
|
|
- Examples: See IncludeTopicsAndWebPages
- Category: ApplicationsAndComponentsVariables, DevelopmentVariables, ImportVariables
- Related: BASETOPIC, BASEWEB, INCLUDINGTOPIC, INCLUDINGWEB, STARTINCLUDE, STOPINCLUDE, STARTSECTION, ENDSECTION, TOC, IncludeTopicsAndWebPages, ParameterizedVariables
|