Get Page Title in template

I am looking to create a template that automatically pulls the page title and includes it in the content. Is there a variable/macro/shortcut that allows us to automatically pull the page title and include it in the content of the page?

2 answers

1 accepted

There are multiple ways to do that including at least:

  1. Write a simple user macro
  2. Run Plugin - {run-now}$page_title{run-now}
  3. Reporting Plugin

Thanks for the reply.

I made a simple user macro that worked like a charm:

## @noparams
$content.title

Hey,

I used the above in my macro and I got the page title.

Now how can I get the first letter in a page title since my pages are named as follows: AF | Afghanistan

I only want to get AF?

@Alexander Wolde 

Alexander,

It looks like Bob was able to point you at the 100% correct solution. I am answering here just to let people know that we have an outstanding feature request for this functionality.

https://jira.atlassian.com/browse/CONF-13715

If anyone is interested in getting this feature rolled into the product itself please visit that issue and vote for it in the upper right hand corner. I am attaching this post to the ticket to further increase it's visibility.

Your solution is a great one. Again I am just adding this for informational purposes.

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...

2,939 views 27 12
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