Description
This macro imports the contents of another page into the current page. This macro differs from the regular confluence include macro in that the content is rendered in the context of the current page rather than the source page.
This subtle difference is particularly useful when you want to store re-usable chunks of menu items on a page - because those menu items may have specific privilege requirements depending on where they are used, they needed to be rendered in the context of the current page in order to always show the correct values and links.
Usage
{import:SPACEKEY:pagename}
Parameters
| Property | Required | Default | Notes | Ver |
|---|---|---|---|---|
| default | the name of the page to import in SPACEKEY:pagename format | |||
| pagetitle | Alternative way of specifying the page | |||
| spacekey | Alternative way of specifying the space key | |||
| flag | The page is imported only if one or more of the specified flags are set. See Working with Flags for more details. | 3.3.6 | ||
| notflag | The page is imported only if none of the specified flags are set. See Working with Flags for more details. | 3.3.6 |
Examples
Simply add the macro any page or panel to import the contents of another page:
{import:TEST:page}
Hints and Tips
None at present.
Frequently Asked Questions
The security restrictions of the source page are honoured - if the user is not allowed to see the source page, this macro won't be able to import it.
.png)








Comments (12)
Mar 15, 2007
Anonymous says:
Why an upper case M in Macro for the title of this page? I was looking for it by...Why an upper case M in Macro for the title of this page? I was looking for it by directly typing the URL and couldn't find it.
Mar 15, 2007
Guy Fraser says:
Fixed - thanks for bringing that to our attention.Fixed - thanks for bringing that to our attention.
Aug 04, 2008
Paul Meehan says:
Am I right in assuming that if the original page has restrictions on it that thi...Am I right in assuming that if the original page has restrictions on it that this macro won't display that content on the page on which it's used?
Nov 02, 2009
Guy Fraser says:
Correct.Correct.
Oct 13, 2010
Jamie Muir says:
I'm trying to use this macro within Theme Builder > Menu Bar > Content. W...I'm trying to use this macro within Theme Builder > Menu Bar > Content.
When I add the following:
{menubar:id=mainmenu} {menubar}I get a second copy of the menu that is already there. I have then copied this to a text file titled 'menu1.txt'. I've uploaded this to the resource area and changed the above to:
{import:menu1.txt}This gives nothing - should it work? Thanks!
Oct 14, 2010
Alain Moran says:
no it shouldn't ... use the LAYOUTID::resource.ext syntax to refer directly to a...no it shouldn't ... use the LAYOUTID::resource.ext syntax to refer directly to a layout resource.
Oct 14, 2010
Jamie Muir says:
Hi Alain, Thanks for the response...having tried several combinations I'm still...Hi Alain,
Thanks for the response...having tried several combinations I'm still not having much luck.
As none of them work I'm guessing my attempts are wrong...
{import:LAYOUTID:menu1.txt}Oct 14, 2010
Alain Moran says:
use two colons .. layoutID :: resource.ext Also replace 'layoutID' with the id ...use two colons .. layoutID :: resource.ext
Also replace 'layoutID' with the id of your layout, or @current::resource.ext to use the current layout, or @parent::resource.ext to get the resource from the parent layout.
Oct 14, 2010
Jamie Muir says:
Wayhey! It was the missing layoutID value that was my mistake. Thanks for your...Wayhey!
It was the missing layoutID value that was my mistake.
Thanks for your help!
Feb 13, 2011
Klaus Feldmann says:
A message tells "import: You do not have permission to view that page" if a user...A message tells "import: You do not have permission to view that page" if a user has no permission to vie an imported page.
Is there a way to just have no message at all?
Feb 14, 2011
Alain Moran says:
Use builder-show to check for the page's existance and the user's permissions.Use builder-show to check for the page's existance and the user's permissions.
Feb 15, 2011
Klaus Feldmann says:
thanks – tried it - but seemes not work with conf. 3.4.8 – message still display...thanks – tried it - but seemes not work with conf. 3.4.8 – message still displayed if user has no permission. It does not shoe message if user has permission but page top be imported does not exist – some kind of vise-versa as it should do.