Create a Glossary in Confluence 4.x - How do I call a multi excerpt include dynamically
Asked by Ray Sanchez:

Hi guys:

I'm trying to create a glossary for confluence by following the follwing article: <http://jodiem.com.au/2011/08/13/building-a-glossary-in-confluence/>

Becuase this is an old article I'm trying to do the same but in Confluence 4.x and I almost had everything working except for the detail that when the glossary link macro is used within the confluence main document it always shown that it found the page Glossary but not the excerpt.

I created two macros:

The create term macro (this is the one used in the Glossary page):

##############################################################

## @param tooltip:title=Tooltip\|type=string\|required=true\|desc=Tooltip

## @param name:title=Name\|type=string\|required=false\|desc=Name

## @param phrase:title=Phrase\|type=string\|required=false\|desc=phrase

\<h3\>

\<ac:macro ac:name="anchor"\>

\<ac:default-parameter\>$paramname\</ac:default-parameter\>

\</ac:macro\>$paramphrase

\</h3\>

\<ac:macro ac:name="cloak"\>

\<ac:parameter ac:name="id"\>$paramname\</ac:parameter\>

\<ac:rich-text-body\>

\<ac:macro ac:name="multiexcerpt"\>

\<ac:parameter ac:name="MultiExcerptName"\>$paramname\</ac:parameter\>

\<ac:parameter ac:name="atlassian-macro-output-type"\>INLINE\</ac:parameter\>

\<ac:rich-text-body\>

\<a style="text-decoration:none; border-bottom:2px dotted; border-bottom-color:#008000" title="$paramtooltip" href="Glossary#$paramname"\>$paramphrase\</a\>

\</ac:rich-text-body\>

\</ac:macro\>

\</ac:rich-text-body\>

\</ac:macro\>

$body

#################################################################

and the glossary link macro (the one that is used in main pages)

#################################################################

## @param name:title=Name\|type=string\|required=false\|desc=Name

\<ac:macro ac:name="multiexcerpt-include"\>

\<ac:parameter ac:name="MultiExcerptName"\>$paramname\</ac:parameter\>

\<ac:parameter ac:name="PageWithExcerpt"\>Glossary\</ac:parameter\>

\<ac:parameter ac:name="nopanel"\>true\</ac:parameter\>

\</ac:macro\>

#################################################################

Any help will be appreciated. If more info is needed just let me know


Answers:
author: Adam Laskowski
body: I also just stumbled upon a 2 part blog that outlines how to create this configuration that doesn't rely on the multi-exerpt-include macro that should get this functionality in place for you:

<http://blogs.atlassian.com/2013/01/how-to-building-a-company-glossary-with-confluence/>

<http://blogs.atlassian.com/2013/01/how-to-building-a-company-glossary-with-confluence-part-two/>


author: Adam Laskowski
body: I tested your user macros locally, and they seem to be fine. I think this is a bug in Artemis's multi-excerpt macro. If you inspect the source of a page with your 'term' macro rendered (via Source Editor), it shows up like this:

```
&lt;ac:macro ac:name="term"&gt;  &lt;ac:parameter ac:name="phrase"&gt;My Phrase&lt;/ac:parameter&gt;  &lt;ac:parameter ac:name="name"&gt;Term Name&lt;/ac:parameter&gt;  &lt;ac:parameter ac:name="atlassian-macro-output-type"&gt;BLOCK&lt;/ac:parameter&gt;  &lt;ac:parameter ac:name="tooltip"&gt;My Hover Text&lt;/ac:parameter&gt;  &lt;ac:rich-text-body&gt;This is a definition of things.&lt;/ac:rich-text-body&gt;&lt;/ac:macro&gt;
```

Then, inspect the source of the rendered page in Firebug or Chrome Dev mode, and you can see that the cloak macro and header macro were able to interpret the $paramname object:

```
&lt;span class="confluence-anchor-link" id="Glossary-TermName"&lt;/span&gt;&lt;h3 id="Glossary-MyPhrase"&gt;My Phrase&lt;/h3&gt;&lt;h3 id="Glossary-TermName"&gt;Term Name&lt;/h3&gt;&lt;span id="content_Term Name" class="cloak" style="display: none"&gt;&lt;a style="text-decoration:none; border-bottom:2px dotted; border-bottom-color:#008000" title="My Hover Text" href="Glossary#Term Name" rel="nofollow"&gt;My Phrase&lt;/a&gt;&lt;/span&gt;
```

Anchor correctly created the "Glossary-TermName" id, and cloak created the "content_Term Name" id. Artemis, the creator of the multi-excerpt plugin, has their support contact details and a link to their Marketplace JIRA instance [here](https://marketplace.atlassian.com/plugins/biz.artemissoftware.confluence.multiexcerpt.MultiExcerptMacro/version/37/support). They should be able to help you sort it out, or confirm the bug.


Tags: glossary