Tricking Pagetree into showing the number of attachements for each page or branch (Newbie Alert, please help)

Hi guys,

Loaded question here. My company just moved to Confluence 6 weeks ago, and I have little programming knowledge. Having spent the last day and a half researching this, I am at my wit's end. Any help you guys can offer is greatly appreciated.

The goal: Have a Pagetree index that lists the title and the number of attachments each page or branch has.

Example: "The Title" (#)

I am having trouble with the following:

  1. Pagetree does not support this. Therefore, I believe the work around (if it is possible) is to directly edit the titles of each page to reflect their number of attachments. The problem is that I have no idea how to do this. I tried using
    public void setTitle(numberOfAttachments) to no avail.  Is there a way to do this?
  2. I don't actually know how to count the number of attachments.  From another post, a user said that I have to reference attachmentManager and use the following code:
    int numberOfAttachments = attachmentManager.getAttachments(page).size(); . The problem is that I don't know how to reference attachmentManager, and all the searching I have done hasn't turned up any info.
  3. Assuming I actually get all of the above, how do I use the variable numberOfAttachments?  I understand parameters, but don't really understand variables in XHTML

1 answer

^It's as if someone out there is mocking me. I can't undo the code tags. If a mod could please help me out here, there is no section for HTML markup.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

54 views 2 4
View post

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