Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to access metadata in a user macro

Bill Bailey September 25, 2014

I want to access metadata set on a page in a user macro, but no idea as to what the object name and methods would be.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2014

You can also access some of the meta data that Confluence puts on a page via Javascript (which can be in a user macro). The method is ..

AJS.Meta.get("key");

The key part is what is in the meta tags on the page minus the "ajs-". So for instance if the meta tag is

<meta name="ajs-remote-user" content="dstuder">

You could get the value via ...

AJS.Meta.get("remote-user");

You can see all of the available ones via...

AJS.Meta.getAllAsMap();
Patrick Doucet July 27, 2016

Hello David,

Can you explain with more details?

I would like to acces metadata in content of a page with a macro like that

$page.getmetadata(FieldName)...

Thanks!

0 votes
Aleš Laňar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2014

Hi, here is a table with accessible objects for Confluence: https://developer.atlassian.com/display/CONFDEV/Confluence+Objects+Accessible+From+Velocity

TAGS
AUG Leaders

Atlassian Community Events