Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Christina Lunk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 1, 2017

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

1 vote
Thomas Schlegel
Community Champion
August 2, 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).

John Corwith
Contributor
August 3, 2017

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.

0 votes
John Corwith
Contributor
August 1, 2017

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)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events