This documentation relates to the latest version of Confluence.
If you are using an earlier version, please go to the documentation home page and select the relevant version.

Include Page Macro

All Versions
Click for all versions
Confluence 2.9 Documentation

Index

You need to edit in 'Wiki Markup' mode to include macros in your page.

The Include Page Macro allows you to display the contents of one Confluence page in another.

To display a page's contents, you require 'View' permission for that page. This is assigned by a space administrator from the Space Administration screens. See Space Permissions or contact a space administrator for more information.

To display part of a page rather than include the whole page, use the Excerpt Macro and the Excerpt Include Macro.

If the name of the included page is changed after you have written the macro, the page name does not change automatically in the macro. You will need to change the page name manually in the macro.

Include Page Macro

What you need to type What you will get
{include:Sample Include Page}

Start of sample page content

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam fermentum vestibulum est. Cras rhoncus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed quis tortor. Donec non ipsum. Mauris condimentum, odio nec porta tristique, ante neque malesuada massa, in dignissim eros velit at tellus. Donec et risus in ligula eleifend consectetuer. Donec volutpat eleifend augue. Integer gravida sodales leo. Nunc vehicula neque ac erat. Vivamus non nisl. Fusce ac magna. Suspendisse euismod libero eget mauris.

End of sample page content

Where:

'Sample Include Page' is the title of the page whose contents you want to display.


Optional Parameter

Display contents of a page located in another space

{include:ds:Confluence Overview}

Where:

'DS' is the spacekey of the other space.
'Confluence Overview' is the name of the page whose contents you want to display.

RELATED TOPICS

Embed only part of an internal page
Embed an external page
Working with Macros

Take me back to Confluence User Guide

Labels:

admin-macros admin-macros Delete
macro macro Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Mar 30, 2006

    Sriram Narayan says:

    Are these includes cached as part of regular page caching?

    Are these includes cached as part of regular page caching?

  2. May 11, 2006

    Alan Meban says:

    In order to provide users of my wiki space with something to read and review off...

    In order to provide users of my wiki space with something to read and review offline on the train (!), I created a page which used the {include} macro to create a page made up of multiple other pages, effectively:

    {include:chapter 1}
    {include:chapter 2}
    {include:chapter 3}
    ...

    The export page to PDF option (icon at top right of screen works well for the text - but it omits any images on the included pages. Is this a bug? or a feature?

    The individual pages (chapter 1, chapter 2, etc) export to PDF with images ok on their own.

    1. Jun 23, 2006

      Ivan Benko says:

      Hi Alan, I have created an issue regarding

      Hi Alan,
      I have created an issue regarding
      http://jira.atlassian.com/browse/CONF-6436
      Please add a watch to it for updates.
      Thanks,
      Ivan

  3. Nov 13, 2006

    Adrian Ellis says:

    I'd like to have another optional parameter "labels=true" whereby the labels of ...

    I'd like to have another optional parameter "labels=true" whereby the labels of the included page will be associated with the including page. This would be very useful to manage labels used on included pages in the same way that the

    Unknown macro: {add-label}
    and
    Unknown macro: {choose-label}
    macros work with page templates.

    In my case I have labels on various distribution notice pages. I would like the labels to be automatically attached to any page that uses the distribution notice so that I can easily check that all content has the correct distribution notice.

    I've created an issue here: CONF-7309

    In the meantime I can use the

    metadata: Required parameter "0" not provided
    plugin for the same purpose, but it is more complicated and therefore less approachable for others in my organisation to implement themselves.

  4. Nov 15, 2006

    Adrian Ellis says:

    sorry forgot to escape the macros

    sorry forgot to escape the macros

  5. Dec 17, 2006

    Ankur Gupta says:

    is there a way to include a page and all its child pages..rather than doing it o...

    is there a way to include a page and all its child pages..rather than doing it one by one?

  6. Mar 13

    James Mortimer says:

    The include macro, metadatafrom macro, and the zonetemplateinstance macro all ve...

    The include macro, metadata-from macro, and the zone-template-instance macro all very simmilar, but subtly different, task. This is not explained in either of their documentation. Perhaps there should be a 'comparison' page?

    CONTENT is the content being included, as named in the 'include' macro
    INCLUDER is the page that contains the 'include' macro

    Behavior Include edit-include Zone-template-instance metdata-from Checklist Reporting plugin
    Includes content from another page or space
    Renders wiki (and links) in context of CONTENT page ?
    Allows access to metadata from CONTENT page ?
    Allows setting of metadata on CONTENT page ?
    Renders wiki (and links) in context of INCLUDER page
    Allows access to metadata from INCLUDER page
    Allows setting of metadata on INCLUDER page
    Allows preview mode
    Allows inclusion of PART of CONTENT page
    Can shows an 'edit' button on included content
    Can shows an intelligent missing page message for missing pages n/a n/a
    Can show multiple pages at once
    Shows 'add new page with this name' link for missing pages

    Syntax

    • {include:spaceKey:pageName}
    • {edit-include:spaceKey:pageName}
    • {zone-template-instance:spaceKey:pageName}{zone-template-instance} * (can also include zone-data tags}
    • {metadata-from:spaceKey:pageName|metadataTag}
    • see documentation for the more complicated checklist, reporting and metadata-report plugins
  7. Jun 28, 2007

    Bradley Mock says:

    Similar to Alan's error above regarding the PDF export: The images are not expor...

    Similar to Alan's error above regarding the PDF export:

    The images are not exported on the include page during an HTML export.  The path is correct in the HTML page exported, but no attachments folder is created and the images are not downloaded.

    1. Jun 28, 2007

      Agnes Ro says:

      Hi Bradely, What version of Confluence are you using? I'm currently working on ...

      Hi Bradely,

      What version of Confluence are you using? I'm currently working on some fixes for both HTML and PDF exports for 2.6 which would also solve this problem.

      Agnes.

  8. Jul 11, 2007

    Charlie Perry says:

    Can I include the contents of a news item from another space? Can't see to get i...

    Can I include the contents of a news item from another space? Can't see to get it to work.

    1. Jul 11, 2007

      David Peterson says:

      As far as I know, this will only include pages, not news items. I haven't actua...

      As far as I know, this will only include pages, not news items.

      I haven't actually tested it, but theoretically you could use the report-info macro from the Reporting Plugin to import a specific news item from another space. Something like this:

      {report-info:content:body|source=OTHERSPACE:/2007/07/12/My News Item|render=wiki}
      
      1. Jul 11, 2007

        Charlie Perry says:

        Thanks. I might just do a bit of cntrlC cntrlV

        Thanks. I might just do a bit of cntrl-C cntrl-V

        1. Aug 07, 2007

          John Price says:

          I sneaked around this problem by marking my whole news item with \ \ and then us...

          I sneaked around this problem by marking my whole news item with {excerpt}{excerpt} and then using

          {excerpt-include:blogPost=/2007/08/06/Shopping Update - August 6, 2007}

           Worked like a charm.

  9. Aug 06, 2007

    Bert Pluymers says:

    It would be useful to include an optional parameter noerror. With the current i...

    It would be useful to include an optional parameter noerror.

    With the current implementation, you get a red error message when the page to be included does not exist (or if the user does not have viewing rights). In some instances you would like this to fail more gracefully, by simply not showing any error message.

    This could help in making a welcome page different for users with different permissions. Until now I couldn't find any way in doing this elegantly. The show-to and include-excerpt macros both seem to discard some of the layout or links, so they cannot be used in that context either.

    It would be nice to be able to use

    {include:page-with-links-that-should-not-appear-for-group-B|noerror=true}
    

    to include links from a page to which group B does not have viewing permissions, without showing an error message to group B.

    1. Aug 06, 2007

      Sarah Maddox says:

      Hallo Bert Many thanks for your support. There is an existing JIRA issue CONF54...

      Hallo Bert

      Many thanks for your support. There is an existing JIRA issue CONF-5436 which may suit your needs. You can vote for the issue, to increase its visibility. You can also log your own suggestions and requests on JIRA.

      Cheers – Sarah

      1. Aug 08, 2007

        Bert Pluymers says:

        Done. Thanks for bringing the JIRA issue to my attention. Bert

        Done. Thanks for bringing the JIRA issue to my attention.

        Bert

    2. Aug 06, 2007

      David Peterson says:

      Hi Bert, I'm curious to know what problems you're having with the \ macro. The ...

      Hi Bert,

      I'm curious to know what problems you're having with the {show-to} macro. The intent is that it basically displays the content or doesn't.

      Aside from that, another possibility is to use the {report-info} macro from the Reporting Plugin:

      {report-info:content:body|render=wiki|source=page-with-links-that-should-not-appear-for-group-B}
      

      Either way, I am interested in any problems with show-to...

      1. Aug 08, 2007

        Bert Pluymers says:

        Hi David, the problem with showto is the following: Using only showto is not ...

        Hi David,

        the problem with show-to is the following:

        • Using only show-to is not the most secure way to go, since it only masks display of certain content but e.g. does not prevent users from finding the content in search operations. When trying to hide certain content (for security reasons) from certain groups of users, this is not what you would like.
        • Another option is to use show-to to hide the include-error to the group with lesser permissions. This goes well, except for the fact that for the higher permission group, the content to be included is included without markup. A list of links becomes:
          * [link 1]  * [link 2]  * [link 3]
          

        I tried using the report-info macro, but this macro produces some very strange errors when trying to include a page where you don't have permissions to. In some cases I ended up with a blanc page, only containing the global logo and the page title. No breadcrumbs, no navigation pane,... In other cases the header right above the include-report macro is being displayed about 40 times after which a java stack overflow is displayed.

        1. Aug 08, 2007

          David Peterson says:

          Ok. Thanks for that. Your first point is a known issue/by design, but fair enoug...

          Ok. Thanks for that. Your first point is a known issue/by design, but fair enough for your situation. The second point is rather odd. What do you mean by the "higher permission group"? Can you post a fuller example of your markup code? Perhaps as a JIRA issue, so we don't clog the comments?

          And with regards to the report-info macro, I'll admit I hadn't actually tried specifying a restricted page directly before...I'll have to investigate that one.

          1. Aug 09, 2007

            Bert Pluymers says:

            Hi David, as you suggested I created a Jira issue https://jira.adaptavist.com/b...

            Hi David,

            as you suggested I created a Jira issue regarding the above mentioned problems with the show-to macro in combination with the include macro.

            Bert

        2. Aug 08, 2007

          James Mortimer says:

          Bert, Take a look at the 'editinclude' user macro for a fairly simple way to w...

          Bert,

          • Take a look at the 'edit-include' user macro for a fairly simple way to wrap a 'error checking' patch around the built in 'include' macro using user macros. (you need to be an admin to write user macros on your installation)
          • I choose to render a message with an 'add-page' link if the target page does not exist or is restricted, but you could modify it slightly to show nothing or a simple placeholder if the 'included' page is resticted.
          1. Aug 09, 2007

            Bert Pluymers says:

            Thanks for the tip James, I will look into it.

            Thanks for the tip James, I will look into it.

  10. Sep 06, 2007

    Ville Valtasaari says:

    Is the sourcecode for the "include page"macro available somewhere. I'd like to l...

    Is the source-code for the "include page"-macro available somewhere. I'd like to look into ajaxifying it as we're having major performance issues w. our Confluence after upgrading from 2.2.9 to 2.5.7 (apparently the new permissions checking system is more cumbersome than the old).

  11. Dec 27, 2007

    Anonymous says:

    I currently have 6 separate templates that collect user input. All 6 of these te...

    I currently have 6 separate templates that collect user input. All 6 of these templates are under a parent page. I want the information from the child pages (collected via templates) to be displayed on the parent page.

    Using the include tag, this works, but I lose all formatting and it includes as blocks of text.

    Any way around this?

    1. Jan 01, 2008

      Choy Li Tham says:

      Hi, Please raise a support ticket at our support system: https://support.atlass...

      Hi,

      Please raise a support ticket at our support system: https://support.atlassian.com. Hence, we can follow up this issue from there. Thanks.

      Regards,
      Choy Li

    2. Jan 08, 2008

      James Mortimer says:

      have you tried using the zonetemplateinstance macro, from the confext:zones plug...

      have you tried using the zone-template-instance macro, from the Zones Plugin, without any parameters. it works like include, but renders AFTER the inclusion, rather than before.

      Not sure what you mean by templates that collect user input, so they might not work with inclusions or zones.