Is there any equivalent variable of @self(The current space) for the page.

I want to be able to use the content by label macro specifiy that the ancestor id as the page itself.

I can manually do this per macro by typing in the name of the page but I want to put the macro in a template and not have to edit the field each time. I know @self is reserved for the space a page exists within but is there an equivalent variable for the a page?

4 answers

0 vote
Stephen Deutsch Community Champion Sep 23, 2015

It doesn't seem like this is possible (there's no reference to the current page in CQL), but if you don't type but instead click in the field for ancestors, doesn't the page you are editing pop up as the first option?

Managed to do with the following user macro:

## Body Processing: No macro body
## @param CQL:title=CQL|type=string|required=false|desc=CQL to filter children with
## @param firstcolumn:title=firstcolumn|type=string|required=false|desc=Title of first column
## @param headings:title=headings|type=string|required=false|desc=Columns to display

 

<ac:structured-macro ac:name="detailssummary" ac:schema-version="2">
    <ac:parameter ac:name="sortBy">title</ac:parameter>
    <ac:parameter ac:name="cql">$paramCQL and ancestor = "$content.getIdAsString()"</ac:parameter>
    <ac:parameter ac:name="firstcolumn">$paramfirstcolumn</ac:parameter>
    <ac:parameter ac:name="headings">$paramheadings</ac:parameter>
</ac:structured-macro>

(Thanks to James Garratt - https://jira.atlassian.com/browse/CONF-38701)

This doesn't help people who are using the Cloud version and can't create custom macros.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,777 views 25 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you