You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have an idea for a way to use Confluence to single-source content for reuse in other applications, and I'm wondering if I can create a plugin (or plugins) to accomplish this.
Example: Let's say I have a page of documentation that includes a one-line definition for an "Item ID". I want that exact same definition to show up as a tooltip in a completely separate application that lets users populate "Item ID".
My idea is that I could tag the one-line definition in Confluence using a custom hidden macro, and give it a unique key like "item-id-definition". The macro would have no visible effect on the documentation.
Let's say in total I have 50 of these text strings, each with an associated unique key. I could then have some process run every couple of hours that pulls in every snippet of text that is tagged with this custom macro, and export the text and the key into a separate database or data file. The application needing the text for the tooltip could then lookup the text by key and pull in the content.
Can this be accomplished?
Thanks for the reply. I'm not seeing any IDs generated by Confluence when I view the HTML source.
Maybe it depends on the version of Confluence you are running?
On a 5.10.8 I get this:
<div class="innerCell">
<h1 id="qqHome-Hello">Hello</h1>
<p>hi</p>
</div>
The 'qqHome' is the (encoded) name of the page the heading (and paragraph) is part of.
OK, I'm able to create those IDs now, thanks. But the issue is that the IDs change whenever the text changes. We'd need the IDs to be static.
This depends on your use case, but if the text you change is in the <p> element (replacing "hi" in the example), then h1 would not change. If this does not suite your requirements (because you need to change the heading), you'd need to check for a macro, such as the Section Macro' Identifier parameter (as I mentioned in my first post).