Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What is the purpose of ac:macro-id? Can it be omitted from User Macros?

Could someone kindly explain - or link to documentation explaining - what the “macro-id” parameter in XML source is used for?

For example, if I create a User Macro that just calls the “cheese” macro twice,
It could be written as:

<p><ac:structured-macro ac:name="cheese" ac:schema-version="1" ac:macro-id="6f58a3b3-35a8-4988-9b6b-0ace97bf6478" /></p>
<p><ac:structured-macro ac:name="cheese" ac:schema-version="1" ac:macro-id="1b7a26f0-73be-4d4c-a46f-6fd2f3463a51" /></p>

or, as:

<p><ac:structured-macro ac:name="cheese" ac:schema-version="1" /></p>
<p><ac:structured-macro ac:name="cheese" ac:schema-version="1" /></p>

Both appear to work.  ...but is there any danger in coding the latter (without the macro-id specified) versus the former?

Thanks in advance!

1 answer

1 accepted

4 votes
Answer accepted
Bill Bailey Community Leader May 17, 2018

I think this is a form of globally unique identifier (GUID), and I have assumed it must be unique for every macro instance. I have always deleted it from my user macros that call other macros and have never seen an issue.

Thank you for your input @Bill Bailey.

I'm also considering simply omitting them in my User Macros.  It makes the code a lot more readable and editable (copy/paste without worrying about unique IDs, etc.).

I'm just concerned that without actually understanding what it is for, that I may run into unforeseen issues later on...

Questions for you: you say omitting the macro-id has never been an issue for you...

  • Do you use any marketplace plugins?  Have they undergone major updates?
  • Have you done a major Confluence update (e.g. v5.x -> v6.x)?
  • Have you ever ported your User Macros to another Confluence instance?

These are the kind of future events that I want to ensure won't affect my User Macros if I leave out the macro-ids.

...also, what about the "ac:schema-version" parameter?  Do you leave that out as well? Appears to work either way...but again, concerned about the omission causing issues in the future...

Bill Bailey Community Leader May 19, 2018

Yes to all:

  • We use a number of free, and paid plugins from the MarketPlace, as well as custom plugins and a number of in-house developed macros.
  • We are currently testing a move from 5.10.8 to 6.2.4. So far have not seen any issues at all with macros. Some of my macros started under 4.x.
  • Yes, we (or rather my customer) have multiple development servers. I also run a production and development server, and use and tested some of the same user macros on both -- again zero issues.

I did research the schema issue some time back, but can't find the details. I know there was a change during 5.x. I just ensure that my macros are updated to reflect the new way to call the macros, so yes I include it.

Thanks again for the input @Bill Bailey.  Your testimonial goes a long way to assuage my fears of omitting them.

Another thing that I've discovered that helps, is using the Confluence Source Editor plugin.  When I copy any paste my code (without the macro-id or schema parameters present) into a page's source editor, when the page is saved, the Confluence Source Editor appears to automatically reinstate the missing macro-id and schema parameters.

That is to say, both of these parameters can be easily re-instated if necessary.

...All that said, I think it's safe to say these parameters (macro-id & schema) can be safely omitted from custom code.

(even though we never figured out what they are actually for... :p ) 

I have iframes in a HTML macro and have been struggling with scrollbars for quite some time. After way too much time trying to figure it out, I find the source code:

<ac:structured-macro ac:macro-id="bca12819-7ce6-44aa-a55d-4f1f2d006db1" ac:name="html" ac:schema-version="1">
<ac:plain-text-body><![CDATA[<iframe src="omitted" width="100%" height="650" scrolling="auto"> </iframe>
]]></ac:plain-text-body>
</ac:structured-macro>

Specifically the ac:schema-version=1 is what is making my iframes have horizontal scrollbars. After removing this and publishing my page, no scrollbars!

Unfortunately I have found that  the Confluence Source Editor appears to automatically reinstate the missing macro-id and schema parameters.

Im no programmer, just trying to edit a confluence page I am building. Any help in trying to figure out a workaround or better way of doing this, please let me know.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

454 views 24 9
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you