Hi,
I've been creating user macro to improve workflows within our team.
One of our team's practices withing a Project's Page Tree is to name the parent page with the "Project Name" and then prefix all child page names with the project name, i.e.: "Project Name - Child Page Name".
By looking at the storage format of a page with a "create from template" macro I fished the format as:
<ac:structured-macro ac:name="create-from-template" ac:schema-version="1" ac:macro-id=ID>
<ac:parameter ac:name="templateName">
TEMPLATE_ID
</ac:parameter>
<ac:parameter ac:name="templateId">
TEMPLATE_ID
</ac:parameter>
<ac:parameter ac:name="title">
$content.getTitle() - This is the title
</ac:parameter>
<ac:parameter ac:name="buttonLabel">
Create Page
</ac:parameter>
</ac:structured-macro></p>
I found that I can get page information via "$content.METHOD" where METHOD comes from this documentation apparently:
https://docs.atlassian.com/atlassian-confluence/6.6.0/
so to get the parent page name I use "$content.getTitle()" because the create from template macro executed on the parent page and then gets carried over to the child page'd title.
My issue is I have not been able to retrieve the list of template names and IDs to put them in an enum type param for the user to pick the template from in the macro settings.
Another post suggested importing other classes like so:
@ComponentImport com.atlassian.confluence.pages.templates.PageTemplateManager
but I have not been able to get values from any other class other than $content.... despite importing others as instructed on another post.
Can anybody shed some light on how to go about this?
Thanks in advance!
Jeronimo
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.