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?

Vladimir Alexiev Jun 03, 2014

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

0 votes
Mehmet Kazgan Jun 04, 2014

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 in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

1,035 views 7 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you