Here is a customized macro image placeholder:
<p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2NvbnRlbnRieWxhYmVsOmNxbD1sYWJlbCA9ICJkYWdkYS1ib2FyZCJ9&locale=en_GB&version=2" data-macro-name="contentbylabel" data-macro-parameters="ppr=rcs "dagda-board"" data-macro-schema-version="3"><br></p>
The "definition=" part of "src" seems generated automatically. And for each macro should has its unique "definition" value. Just curious that how it created by what kind of rules? Any document mentioned these knowledge?
And any possible reason that may cause macro image placeholder
"src" SAME?
Thanks in advance.
Hi @AustinS,
I assume you are able to access to Confluence source code. The above image is generated via this servlet com.atlassian.confluence.tinymceplugin.placeholder.MacroPlaceholderServlet
You can check it out the logic and the rule from inside the doGet method of this class
That is true as you guessed. The "definition" part of the url contains the macro definition information
That you can refer to the class com.atlassian.confluence.xhtml.api.MacroDefinition
And the logic to render that url is placed in this class com.atlassian.confluence.content.render.xhtml.editor.macro.CustomImageEditorMacroMarshaller, see marshal method for further information
I hope this helps
Cheers,
Minh Tran
Thanks for these helpful information, Minh.
One more question related to this, I'm developing a user macro that will be used multiple time on one page, and I found "Edit" button which under <div class="panel-buttons" > and belongs to <a href="#" class="aui-button macro-placeholder-property-panel-edit-button first"> element, is SHARED by any user macro of one Confluence page. That means for these user macros on same page, "Edit" feature don't know / can't identify which macro should be edited.
Is there a workaround can be used to edit user macros on the same page and can get properties (parameters) of each macro correctly when re-open or re-edit it? Or any API can I use in user macro? How do I do it?
I know in non user macro, which has preview, "Edit" button can identify which one is which one on a page, and can retrieve macro properties correctly. I used "
AJS.MacroBrowser.setMacroJsOverride
" to override the "opener" to open my own custom "MacroBrowser". But I'm not sure why "Edit" button doesn't work to retrieve the macro's parameters when we re-open and edit it.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.