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!
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...
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes to all:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.