How do I make the output of a user macro visible in the search?

I have a user macro that creates a unique document reference, but when I search for documents using the generated reference they do not appear. Am I missing something?

1 answer

0 vote
Stephen Deutsch Community Champion May 05, 2016

The search does not search the visible results of all macro outputs on the page, but instead it searches only the same text that would be available in the editor.

If you want it to be able to be searchable, then I would recommend making a part of your user macro create an invisible div (can be done with class="hidden") and save it to the end of the page. Something like this:

<div class="hidden">your-document-reference</div>

Your user macro can search if the hidden div exists, and only if it doesn't exist, then it will create one (that way it doesn't create a new div and page save every single time).  Because it is then saved in the storage format, it should show up in the search.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted 24m ago in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

7 views 0 1
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