Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

conditional display of confluence content?

Vladimir Alexiev June 3, 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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 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
TAGS
AUG Leaders

Atlassian Community Events