User Tools

Site Tools


wiki:plugins:include

This is an old revision of the document!


Table of Contents

Include Plugin

This plugin allows you to include another wiki page into the current one.

Usage

Simply enclose the ID of the page to be included in double curly brackets:

{{page>[id]#[section]&[flags]}}
{{section>[id]#[section]&[flags]}}
[id] page ID of the page to include; some macros are possible; shortcuts are resolved (:, ., ..) required
[section] limits the included page to a specific section and it's subsections optional; default is the whole page
[flags] flags delimited by &, see flags optional

The plugin offers two syntaxes, {{page>...}} and {{section>...}}.

  • page doesn't attempt to merge indentation, allowing the include to be used within other block syntax modes. Don't use multiple instances of {{page>...}} in the same section as it will cause indention problems.
  • section will attempt to align the include information with the current indentation level, allowing sections to be included seemlessly. This should only be used in plain DokuWiki markup as it will result in invalid XHTML if used within other blocks.

Section is aimed more at including sections and page at including whole pages, however both can be used to include whole pages or individual sections. The key difference is how they will interact with sections and block syntax modes on the host wiki page.

Macros

Simple macros are possible to serve a page on a per user or per date base. These are:

@USER@ username
@NAME@ full name of user
@GROUP@ first group the user belongs to
@YEAR@ 4-digit year
@MONTH@ 2-digit month
@DAY@ 2-digit day

Examples:

{{page>@MONTH@:@DAY@:birthdays}}
{{page>@USER@:message}}

Flags

You may use flags to override default settings of the firstseconly and showfooter options:

Setting Default Alternative
firstseconly fullpage includes the whole page firstseconly includes only the first section of a wiki page
showfooter footer shows a footer below the page with info about the included page nofooter hides the page info footer

Example:

{{page>concept&firstseconly&footer}}
wiki/plugins/include.1187121131.txt.gz · Last modified: 2009/06/08 11:32 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki