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

conditional display of confluence content?

Is there a way to display content in confluence 3.5 based on some condition? Eg the presence of a label is good enough.

The if-label user macro is almost perfect, but it doesn't work well for:

  • list item: starts a new list or, weirdly, subitem
  • table row: starts a new table

Thanks in advance for any answers! Bounty 20 points is on offer :-)

1 answer

How about using html macro and adding javascript in there:

<html>
<body>
<div id="container" style="float:left;">
my<br> dynamic<br> contents
</div>

<script type=text/javascript>
var container = document.getElementById('container');
var containerHeight = container.clientHeight;
 
if (containerHeight >= 100) {
    dispaly("big sideBanner");
} else if (containerHeight > 50 && containerHeight < 100) {
    display("middle sideBanner");
} else {
    display("small sideBanner");
}
</script>
</body>
</html>

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

111 views 0 10
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