It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I find the selector for a plugin

I want to hide the output of a macro/plugin when I export to PDF. I've seen, which is fine as far as it goes. However, it only tells me how to turn off the output of the attachments macro, not how to turn off the output of any other macro. So how does one get the value of a plugin/macro selector? For attachments is it ".plugin_attachments_container", but how do you get that information?


2 answers

1 accepted

0 votes
Answer accepted

It's too bad plugin authors don't think through their design. Hiding their plugin in the output file seems to me to be an obvious option.

I was trying to hide the output of the Page Approval macro. Following your suggestion I:

  • Added the macro to a page
  • Output the page to HTML (it's always a ZIP file, so you have to extract the result, not a big deal, but yet another step)
  • Looked in the HTML for the <div> wrapping the Page Approval information. The class is "pageapproval", as I had expected/hoped.
  • Added the following to the PDF Stylesheet:

    div#pageaproval { display: none; }

And the output no longer has the Page Approval information. Note that I also had to make sure the PageApproval macro was in it's own paragraph, otherwise the rendering was off

0 votes
Joe Clark Atlassian Team Oct 16, 2012

Hi Doug,

There's no easy answer for this - it's going to be different for each macro. You'll need to examine the HTML output of a particular macro (you can do this using a developer tool such as FireBug) and identify the top-level element for that macro.

If you look at the output of an attachments macro, you'll see that the outer-most HTML element for the macro is a <div> with a class of "plugin_attachments_container".

Which macros are you looking to hide, specifically? I can give you a hand identifying the styles you need.

Hi Joseph, Im looking for the jira buttons macro selector.

Specifically need to find the way to hide a few thousand jira single buttons from a few hundreds confluence pages during pdf export.

div.??? {display:none}

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Thursday in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

252 views 0 12
Read article

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