Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Include macro doesn't work when special characters are used in the page title

Tyler K. May 7, 2012

When trying to include a page with special characters I get an error:

Unable to render {include} The included page could not be found.

For instance using the include macro to include a page titled: Special Character Test :"<>?,./;'[]{}!@#$%^&*()_+=-\][

will not render.

4 answers

0 votes
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2014

We ran into this problem, too, so I did as CharlesH mentioned and wrote a user macro to include a page based on the page ID. Maybe it will also be helpful for someone else who could not yet upgrade to 5.5.

## @param PageToInclude:title=Page ID of page to include|type=string|required=true
#set ( $Long = $generalUtil.getSystemStartupTime() )
#set ( $pageId = $Long.parseLong($paramPageToInclude) )
#set ( $page = $pageManager.getPage($pageId) )
#set ( $pageContent = "Page not Found" )
#set ( $pageContent = $page.getBodyAsString() )
$pageContent

0 votes
Tom Moors
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2014

This issue is resolved in Confluence 5.5: https://jira.atlassian.com/browse/CONF-24785

Great news!

0 votes
hsuhailah
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 22, 2012

Doubled check on this and it seems to be a limitation of include page macro. However, the above suggestion might be possible.

0 votes
CharlesH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2012
Hi, An alternative to the standard include macro would be to use Reporting in this case. It may handle the special characters better. If you follow this link (http://confluence.atlassian.com/display/DOC/Excerpt+Include+Macro?focusedCommentId=277250731#comment-277250731) you'll see details of how to use report-info macro to pull back a specific excerpt, or indeed, the entire contents of a page. If this doesn't work then I'd suggest a user macro could achieve your goal, provided you pass the page ID to indicate the page you're interested in. Hope this helps, Charles

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events