authors (intermediate)
The (:include:)
directive makes it possible to insert the contents of other pages into the current wiki page. All of the include directives below perform a straight text inclusion. In particular, any page links in the included text are assumed to link to pages in the current group if not otherwise qualified.
(:include PageName:)
(:include Group.PageName:)
(:include PageName#from#to:)
(:include PageName#from#:)
(:include PageName##to:)
(:include PageName#from:)
[[#from]]
and [[#to]]
anchors. If "to" is omitted (second example), then all of the lines after [[#from]]
are included (and vice-versa if "from" is omitted). In the last example, include everything between [[#from]]
and the next anchor.
(:include PageName lines=10:)
(:include PageName lines=5..10:)
(:include PageName lines=5..:)
(:include Page1 Page2 Page3 lines=1..5:)
(:include PageName self=0:)
self
can be 0
or 1
. It tells the include directive if it is allowed to include the current page. This is useful if PageName is a variable like {$Name}
and you want to prevent the directive from including the current page.
By default, Included pages or lines cannot be distinguished from other text on the page. To provide a visual indication that this text is special, you can apply WikiStyles. For example:
What is PmWiki? PmWiki is a wiki-based system for collaborative creation and maintenance of websites.
PmWiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website, using basic editing rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors. Have a very nice day! |
(:include My/Page#myanchor lines=4:)
which starts from, and includes, the line with the anchor [[#myanchor]]
for four lines.
<< Page directives | DocumentationIndex | InterMap >>
What's the maximum number of includes that can exist in a page? My site seems to stop including after 48 includes.
By default, PmWiki places a limit of 50 include directives for any given page, to prevent runaway infinite loops and other situations that might eat up server resources. The limit can be modified by the wiki administrator via the $MaxIncludes
variable.
This page may have a more recent version on pmwiki.org: PmWiki:IncludeOtherPages, and a talk page: PmWiki:IncludeOtherPages-Talk.