Integrating the Scroll Pagetitle Macro within a custom macro
Hello there,
I created a macro displaying the current documentation status of my Confluence page. In this macro I am calling both the Scroll Ignore-Macro and the Scroll Pagetitle-Macro to get this information inside my Word file.
While the behaviour of the Scroll-Ignore-Macro works totally fine, the Scroll Pagetitle-Macro seems to somehow be ignored.
The text I want to insert into the Scroll Pagetitle-Macro is still plain text. Using only the macro with the same text inserted works perfectly fine. So the mistake shouldn't occure because of the value...
I tried to call the macro inside my macro in two different ways:
1. in the storage format (<ac: structured macro ac:name="scroll-pagetitle">....<ac:structured-macro>
2. rendering the macro inside my macro ($action.getHelper().renderConfluenceMacro("{scroll-pagetitle}Neuer Text{scroll-pagetitle}"))
Neither of these two ways worked out...
Is there any way to get this done? Is the way, the macro gets evaluated, preventing the proper execution inside my custom macro?
-
Hi Marcel,
Thanks for getting in touch.
I just discussed your request internally and unfortunately there's no way to use the Scroll Pagetitle Macro within a user macro, as our macro stores the page title in a content property on the page every time the page is saved, but not when the macro is rendered.
Right now there's no supported option to include the page title set with our macro (you could try to somehow get the content property "metadata.scroll.pagetitle", but this is not officially supported and it might change in a future version without further notice).
Best,
Nils -
Hello Marcel,
I'm also using a custom macro and would like to call the Scroll-Ignore-Macro. Can you point me in the correction direction?
I'm pretty new to Confluence and I'm slowing starting to create custom macros. I created a macro that includes some fields to be supplied by the user and includes a Button with a drop down that allows to export to word (we have number of different schemas to export). This button is showing up in the export and I wanted to use the Scroll-Ignore Macro in my custom macro to ignore this. Any suggestions would be great!
Melissa
-
Hi Melissa,
to use a macro within your custom macro, you just need to use the xhtml-storage format of the wanted macro.
You can see the storage format right here:
The source of the macro should then look like this:
<ac:structured-macro ac:name="scroll-ignore" ac:schema-version="1"><ac:rich-text-body> <p>Test</p></ac:rich-text-body></ac:structured-macro>
When your macro in the Editor looks like this:So when you copy+paste the storage format of another macro in your custom macro, it should be executed.
I hope this can help you a little bit :)
Marcel
Please sign in to leave a comment.
Comments
5 comments