This page last changed on Feb 12, 2007 by mryall.

Summary

Inserts the contents of the specified page into the current one.

Usage

{include:Some page}

{include:spaceKey=KEY|pageTitle=Another page}

Parameters

Parameter Required Default Description
(default) yes, if no pageTitle parameter none Name of a page in the current space to include
pageTitle yes, if no default parameter none Name of a page to include
spaceKey no current space Key for space which has the page

Notes

Users without permission to view the included page will see an error that the page could not be found.

A page cannot include itself or a page that includes itself. An error message will be displayed if this occurs.

Very nice macro! Solved a problem I was facing (mirroring pages). But I wonder if it can be improved such that the attachment etc. therein could be automatically working?

i.e., if I have a page titled "test" with an attachment "test.xls" in space abc, and its content is simply a link to attachment [display excel|^test.xls]. Now in space def I want to mirror abc:test, I simply create a new page "testmirror" and use the include macro. The problem is, the attachment is missing when viewing "testmirror". One way to solve this is to change the content of "test" to [display excel|abc:test^test.xls], but this is not ideal - when there's a need to rename "test" or move "test" to another space, the link in "test" would break again.

The more elegant way of handling this would thus be that the include macro processes the included content and add missing spacekey or page title when needed, on-the-fly. That'll solve all problems. I guess the difficulty of implementing it depends on how the macro itself is implemented.

Mingyi

Posted by at Aug 08, 2005 15:19

Are there any plans to open this up to cross space includes? How about including content from attachments, templates, files - see the scriptiong macros as examples of where content could be taken from? Of course with the proper handling of permissions.

Posted by bob.swift@charter.net at Nov 17, 2005 19:52

Are there any plans to make it possible to tag sections of pages and include only specified sections?

We use wiki for most of our plans and that feature would make it possible to create a page which includes for example only the resourceplans for each project at one place.

Posted by makr at May 10, 2006 06:17

You can do that with the Metadata Plugin which essentailly turns Confluence in to a giant spreadsheet

Posted by gfraser at May 10, 2006 06:22

You could use the excerpt-include and excerpt macros to indicate what block of text to include.

Posted by husted at Jun 10, 2006 09:37

I have created a page which "includes" 4-5 other pages. Is it possible to create a view which can display all the pages included alongwith the original page, as a ONE BIG PAGE?

Thanks in advance

Madhu

Posted by madhugr at Jun 28, 2006 03:31

I am in need of the include-functionality, but for pageID:s, not page titles. Is this something you will add to the include macro, or is it possible to solve the need for including different versions of a page into another page??

Most greatful for a quick response...

/Eva 

Posted by eva.andreasson at Oct 09, 2006 07:51

I am also looking for this function. I don't want to just concatenate data chunks though, so I don't think the Metadata plugin works for me. I'd like for each of my writers to create content plans, and then I want to pull pieces of the various plans into anotehr page in the wiki.

Posted by sltrunzo at Oct 16, 2006 15:20

Sorry, Eva, this is not available at the moment. Page IDs would be the easiest way of implementing this, so please raise a feature request on JIRA.

Posted by mryall at Feb 12, 2007 13:33

Cross-space includes have been available since Confluence 1.4. I've updated the documentation above to reflect this.

Attachment includes are dependent on the kind of content they contain. For Excel spreadsheets we have the Excel macro plugin. For other document types, please raise a feature request so we know what you would like to use.

Posted by mryall at Feb 12, 2007 14:05

The linking of content within the included page was fixed in Confluence 1.4. Please raise a bug in JIRA if you find any more problems with this macro.

Posted by mryall at Feb 12, 2007 14:06
Document generated by Confluence on Mar 22, 2007 20:54