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
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,548 views 4 13
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