Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the name of the page using a macro

Richard Coffre
Contributor
April 19, 2018

Hi all,

 

Currently I'm using a macro to retrieve the version of a page by using $content.version in a macro.

I have tested a duplicate of this macro writing $content.name.

Bad guess, it failed.

How can I retrieve the name of the current page?

Moreover, where could I find a documentation about $content and its attributes and methods?

 

Best regards,

Richard

1 answer

3 votes
Prakhar Srivastav {Appfire}
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.
April 19, 2018

Hi Richard Coffre

Try $content.getTitle()

$content is actually ContentEntityObject and you can use all the methods available.

These links may be helpful for you.

https://confluence.atlassian.com/doc/user-macro-template-syntax-223906130.html

https://docs.atlassian.com/DAC/javadoc/confluence/4.0/reference/com/atlassian/confluence/core/ContentEntityObject.html

 

Regards

Prakhar

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events