Include
The {{include}} embedding pulls another page, or a single section of it, into
the current page. The examples below all include
the sample page.
The whole page
{{include|src=/Examples/Include/Sample Page}}
A single section
section is the heading anchor slug (lower case, spaces as dashes), matched
independently of the heading level. children=true (the default) pulls in the
subsections too, so this also brings along Sea Otters.
{{include|src=/Examples/Include/Sample Page|section=otters}}
A section, without its subsections or heading
children=false stops at the next subheading and heading=false drops the
section's own heading line, so this includes only the paragraph directly under
Otters.
{{include|src=/Examples/Include/Sample Page|section=otters|children=false|heading=false}}
Things to watch out for
- Use absolute paths inside included content. Relative links and
attachments (
) in the source resolve against the including page, not the source page, so they break. Write/Source/Page/image.pngin anything meant to be included. That is whysrcabove is written absolute as well, though relativesrc(resolved against this page) also works. - Headings from included content do not show up in this page's table of contents.
- Do not combine a
{{DataTable}}and an{{include}}on the same page; the page's own DataTable can be left uninitialised. Keep them on separate pages. - Includes nest at most 8 deep, and cycles (a page including itself, directly or through a chain) are detected and reported rather than expanded.
See the Include documentation for the full option list.
