Can I display the excerpt on the same page where the expert is?

I have an excerpt macro on the page "Overview" (in the middle of the page) and I want to show this excerpt on the same page "Overview" at the very top. 

 

Thus I have an excerpt include macro refering to an excerpt on the same page. 

 

It does NOT work... did I do anything wrong, or does this just not work and: is ther e an alternative to make it work (show a bottom part of the page at the top like an excerpt)? 

2 answers

Since this doesn't work (for me either) and I assume you don't want to have your overview information on a child page (which you could then use either the Excerpt Include or Include Page macro twice on your parent page) I think your only option is a custom User Macro as I can't think of a way to do this with standard/included macros. (I didn't look in the Atlassian Marketplace.)

You could use the code at the top of the first response in this question to set your overview as page metadata, creating one macro to write it and one to read it (like Excerpt/Excerpt Include) or a single dual purpose macro.

You need Confluence admin priviledges to develope and deploy User Macros.

Something along these lines: (I couldn't currently test.)

# Macro name: dittomark
# Macro Title: Ditto Mark
# Description: Marks text for display in multiple places on the same page.
# Macro Body Processing: Rendered

## param dittoMarkID:title=Ditto Mark ID|type=enum|enumValues=dittoID0,dittoID1,dittoID2,dittoID3,dittoID4,dittoID5,|default=dittoID0

#set ( $containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager') )
#set ( $getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null) )
#set ( $containerManager=$getInstanceMethod.invoke(null,null) )
#set ( $containerContext=$containerManager.containerContext )
#set ( $contentPropertyManager=$containerContext.getComponent('contentPropertyManager') )

$contentPropertyManager.setTextProperty($content, $paramdittoMarkID, $body)
$body

# Macro name: dittodisplay
# Macro Title: Ditto Display
# Description: Displays ditto marked text in multiple places on the same page.
# Macro Body Processing: Rendered

## param dittoMarkID:title=Ditto Mark ID|type=enum|enumValues=dittoID0,dittoID1,dittoID2,dittoID3,dittoID4,dittoID5,|default=dittoID0

#set ( $containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager') )
#set ( $getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null) )
#set ( $containerManager=$getInstanceMethod.invoke(null,null) )
#set ( $containerContext=$containerManager.containerContext )
#set ( $contentPropertyManager=$containerContext.getComponent('contentPropertyManager') )

$contentPropertyManager.getTextProperty($content, $paramdittoMarkD)

0 votes
Thomas Schlegel Community Champion Aug 02, 2017

Hi Christina,

another workaround is:

  • mark your excerpt on the original page 
  • create a second page, put an excerpt macro on that page
  • put an excerpt include into that excerpt macro. The source is the original page
  • add an excerpt include to the original page. The source is the second page

It's a little bit dumb to create an extra dummy page for that purpose, but I don't see another way (except programming your own code as John suggested).

Another thing to note is you can put the 2nd page in a different space if you are using any of the search macros to have it excluded from any local space searching. This also eliminates it from the local space tree.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,044 views 15 13
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you