Can I display the excerpt on the same page where the expert is?
Asked by Christina Lunk:

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)?


Answers:
author: Thomas Schlegel
body: 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).

comments: author: John Corwith
body: 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.


author: John Corwith
body: 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](https://confluence.atlassian.com/doc/writing-user-macros-4485.html) as I can't think of a way to do this with standard/included macros. (I didn't look in the [Atlassian Marketplace](https://marketplace.atlassian.com/addons/app/confluence).)

You could use the code at the top of the first response in [this question](https://community.atlassian.com/t5/Answers-Developer-Questions/How-do-I-store-persistent-values-in-a-User-Macro/qaq-p/511376) 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)


Tags: excerpt