[All Adaptavist Apps]
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.
{import:SPACEKEY:pagename}
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 |
Simply add the macro any page or panel to import the contents of another page:
{import:TEST:page}
None at present.
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.
12 Comments
Anonymous
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.
Unknown User (gfraser)
Fixed - thanks for bringing that to our attention.
Unknown User (paulmeehan)
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?
Unknown User (gfraser)
Correct.
Unknown User (jmuir)
I'm trying to use this macro within Theme Builder > Menu Bar > Content.
When I add the following:
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:
This gives nothing - should it work? Thanks!
Unknown User (amoran)
no it shouldn't ... use the LAYOUTID::resource.ext syntax to refer directly to a layout resource.
Unknown User (jmuir)
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...
Unknown User (amoran)
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.
Unknown User (jmuir)
Wayhey!
It was the missing layoutID value that was my mistake.
Thanks for your help!
Unknown User (orgetex)
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?
Unknown User (amoran)
Use builder-show to check for the page's existance and the user's permissions.
Unknown User (orgetex)
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.