This question is in reference to Atlassian Documentation: Page Properties Macro
I would like to read the page properties and display the result in a custom layout.
I know the Free Plugin "GetMetadata" from Comala but with this plugin I can't read metadata in another page...
Can you help me?
Thank you!
Does anyone have an example of a PagePropertyExtractor class in Java that can read the page properties from the page body?
I want to build a simple search with which I can filter for the page properties. Now it would only work afterwards. That means, I search for pages by title and filter the result by the specified page properties.
It is not possible to lift the content of the 'page properties macro' directly. I'd like explain the difference between some things here –
I believe the Page Properties Report macro searches for pages with the correct labels on them, parses the page content for the Page Properties Macros, and then pulls the interior <table> element for reporting. You would have to do the same to obtain the data inside the macro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The JAVA API I am sure would be preferable due to speed. You could use the REST API to use a CQL query like such – https://confluence.example.com/dosearchsite.action?cql=siteSearch+~+%22macroName%3Adetails%22+and+type+%3D+%22page%22+and+label+%3D+%22my-label%22&queryString=macroName%3Adetails
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"You would have to do the same to obtain the data inside the macro."
Yes...And How I do that? I need to do that, i woluld like a custom layout.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to display data on the same page it is stored, the only solution I know of (and have used) is via the metadata plugin.Since it is free (and has been for years), that is the best/easiest solution.
Where I got the syntax was from here: https://help.k15t.com/scroll-pdf-exporter/using-page-properties-as-placeholder-101157314.html
But even if that method is available, I typically have based variables using the metadata plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bill,
To use page properties as placeholders:
Open your template and insert the placeholder in the following pattern:$pageProperty.from("User") Please note that the placeholders are case-sensitive.
This placeholder will be replaced with the corresponding value stored in the content properties macro for the key with name "User".
If you have multiple page property macros on your root page, you have to assign an ID to the macros and refer to this ID in your template.
For example:$pageProperty.from("User", "123")
This placeholder will be replaced with the corresponding value stored in the content properties macro with ID 123.
Step 1 : OK
Step 2 : OK
Step 3 : OK
Step 4 : ??? I need more explanation...
Step 5 : OK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is in reference to K15t velocity templates, but could give you a clue of how to address them (I haven't tried this). I am assuming that it will display the value on the page.
From the metadata plugin, there is the following method:
getMetadataValues(String token, String spaceKey, String pageName)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So... How I can use it?
In a macro like this?
<p>
<ac:structured-macro ac:macro-id="5b3f7bcc-12c8-4b82-afd6-93e41192cfb5" ac:name="metadata-values" ac:schema-version="1">
<ac:parameter ac:name="0">Source</ac:parameter>
<ac:parameter ac:name="1">SGDE</ac:parameter>
<ac:parameter ac:name="2">SYS-0004</ac:parameter>
</ac:structured-macro>
</p>
This macro doesn't work...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I tried $pageProperty.from("Field1") in a page with a property "Field1" but It doesn't work...
Where did you find the name of this calss? I didn't find it in the https://docs.atlassian.com/atlassian-confluence/5.9.9/.
My macro is:
-------------------------------------------------------------------------------------------------
## Developed by: <your name>
## Date created: 27/07/2016
## @param filter:title=Filter|type=string|required=false|desc=Label filter
<li>$pageProperty.from("Source")</li>
-------------------------------------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it is of the form: $pageProperty.from("User") where User is the key. And $pageProperty.from("User", "123") when you have macros with IDs.
How to access from another page, I am not clear on, but maybe this gets you started and you can report back?
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.