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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Deprecation of $content.getLabelUtil()

My Macro:

 

## @noparams

<div id="related-content">

<script language=javascript>

function toogle(divname) {
if (document.getElementById(divname).style.display != "block") { document.getElementById(divname).style.display = "block"; }
else { document.getElementById(divname).style.display = "none"; }
}
</script>

#if($content.getIdAsString()!='4161541')
#set($wiki="")
#set($globalHelper=$action.getHelper())
#if($content) ## i. e. we render a normal page
#set($renderer=$globalHelper.getWikiStyleRenderer())
#set($context=$content.toPageContext())
#set($labelList=$content.getGlobalLabels($action.getRemoteUser()))
#if($labelList.size() > 0)
#set($labelUtil=$content.getLabelUtil())
#set($labels=$labelUtil.convertToDelimitedString($labelList))
#set($labels="'"+$labels+"'")
#set($labels=$labels.replace(" ","','"))
<h1><a href="javascript&colon;;" onclick="toogle('rcontent');">Sider med lignende indhold</a></h1>
<br>
<div id="rcontent" name="rcontent" style="display:block;">
<ac:structured-macro ac:macro-id="e5bbc54f-287e-447c-9e9e-f84af88ad353" ac:name="contentbylabel" ac:schema-version="2">
<ac:parameter ac:name="showLabels">false</ac:parameter>
<ac:parameter ac:name="cql">label in ($labels) AND label != "noshow"</ac:parameter>
</ac:structured-macro>
</div>
#end
#end
#end
</div>

 

Is not working in C7, seems $content.getLabelUtil() is deprecated.... https://confluence.atlassian.com/doc/deprecated-code-paths-removed-in-7-0-967879993.html

 

Ok, what do I do? Ad get whats possible with $content ? All I find is C6.6 related

1 answer

0 votes
Diego Atlassian Team Oct 28, 2019

Hello, @Normann P_ Nielsen _Netic_ !

I understand that is can be quite troubling when something is deprecated or completely removed from an array of tools that we are accustomed to using.

The content.getLabelUtil() method has been deprecated in a previous version of Confluence. Confluence 5.2, to be more precise. Here you can check this information:

 

Here is a screenshot of that page:

Anotação 2019-10-28 171136.jpg

 

According to the deprecation notice, we should start using LabelUtil directly. Here is a link to it:

 

If you need further assistance with developing questions, you can reach to our Developer Community, Normann. Here, take a look!

 

Let us hear from you!

As in: #set($labels=$content.LabelUtil().convertToDelimitedString($labelList)) ?

 

That does not work ...

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

454 views 24 9
Join discussion

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