The {add-label} macro allows you to add one or more labels to a page automatically.
The macro is designed to be used in templates, scaffolds and other automatically generated content where there is a need to ensure that one or more labels are always added.
To define a label to be added anywhere within your content, use the following notation:
{add-label:label1,label2,label3}
See the examples below for more information.
This plug-in is available without cost for both commercial and non-commercial purposes. However, if you have found it to be useful, particularly within a commercial environment, please consider making a donation to the author. This will encourage continued development of this and other plug-ins, as well as speeding up the response for your latest maintenance request.
If you wish to donate, it can be done easily with a credit card or bank transfer using PayPal. No account sign-up is required for credit or debit card payments.
This macro has been tested by Adaptavist with Confluence 2.1.2
It is usually pre-installed when using our Host service. To install it on your own Confluence installation, please see Label Tools Plugin
Adaptavist maintain a JIRA Project for tracking bug reports and feature requests for this macro. The currently reported items are shown below:
jiraissues: Could not download[ http://jira.adaptavist.com/secure/IssueNavigator.jspa?view=rss&pid=10200&component=10290&statusIds=1&statusIds=3&statusIds=4&statusIds=5&sorter/field=updated&sorter/order=DESC&tempMax=25&reset=true&decorator=none] : caused by : Circular redirect to 'http://jira.adaptavist.com:80/secure/IssueNavigator.jspa'
I'm using this add-label macro in a Global Template and filling in the label information using a variable. When the template is used the folowing exception is reported in the Fill in template variables page.
Error formatting macro: add-label: java.lang.IllegalStateException: Content must be persistent before it can be labelled.
Thing is...this actually works and is extremely useful for us in setting up testcase pages using the meta-data plugins. Is there any way this exception could be suppressed? Right now, we just tell users to ignore it when creating a Testcase page based on our Testcase Template and everything works great! Just would be nice if we didn't have to explain that this exception can be ignored.
Curiously, I'm seeing the opposite behavior. When in a Global Template I provide the add-label macro with string literals (i.e. text) I get the error message you describe at the moment I actually use the template. However, if I use (VAR) type (built-in form field) variables in the add-label macro I get no error messages from the macro at any point in the page generation process. This is a great macro!
Maybe a great addition would be to also make it the other way around
{remove-label:alabel}
{remove-labels}
Because if i have added a label with scaffolding to a page (select option a --> labela) and on second thought i would like to edit the page and select option b --> add-label labelb it still containts labela
Just curious. Is there anyway to automatically add labels to a news post when it is created? I want to use the blog post macro in a space to collect only a specific type of news item as indicated by a label. I realize I can have people add the label themselves, but I would really like to cut out the middle man.
Were you able to get an answer on this? I am trying to set the labels to a news post or pages that are created from a parent page. I have not been able to find a way to do this.
I love the add-label macro, but some of our folks would like to have the template prompt users to choose a label from a list. I had hoped that I could combine the add-label macro with the form markup used in templates like this, but it doesn't work:
Of course, we want the outcome to be a list of labels like "solution, motorola, coverage" so that people could search for content of type 'solution' for the 'Motorola' customer that addresses the 'coverage' subject matter.
Is there a workaround or alternative for this use model that I can try instead? Does anyone else want to choose labels from a predetermined list?
Hello
Great macro to get paged labeled automatically...but I desparetly try to get the value from a scaffold live-template list-data and can't get it to work...
No - it's a problem with scaffold plugin and the latest confluence (2.5 and above I think). Please check with the author of the scaffold plugin for more info.
Hi,
im using add-label macro.
Is there any way that only the certain group of people can both edit and view
the label. while other group of people can only view the label.
Is it possible to add the support of adding dynamic content to label?
a example will be {add-label:{pageid}} in which the macro
I second this request. I need {add-label:{metadata-from:Random Page|randomValue}}...
Thanks for considering it!
I'm using this add-label macro in a Global Template and filling in the label information using a variable. When the template is used the folowing exception is reported in the Fill in template variables page.
Error formatting macro: add-label: java.lang.IllegalStateException: Content must be persistent before it can be labelled.
Thing is...this actually works and is extremely useful for us in setting up testcase pages using the meta-data plugins. Is there any way this exception could be suppressed? Right now, we just tell users to ignore it when creating a Testcase page based on our Testcase Template and everything works great! Just would be nice if we didn't have to explain that this exception can be ignored.
Curiously, I'm seeing the opposite behavior. When in a Global Template I provide the add-label macro with string literals (i.e. text) I get the error message you describe at the moment I actually use the template. However, if I use (VAR) type (built-in form field) variables in the add-label macro I get no error messages from the macro at any point in the page generation process. This is a great macro!
I fixed this by the way in the 1.1. release of the labeltools plugin.
Kelsey Grant
The plugin seems to be broken on this page.
Maybe a great addition would be to also make it the other way around
{remove-label:alabel} {remove-labels}Because if i have added a label with scaffolding to a page (select option a --> labela) and on second thought i would like to edit the page and select option b --> add-label labelb it still containts labela
Hi there,
I'm using the 1.1. version of the labeltools plugin, and when I try to use the
Error formatting macro: add-label: java.lang.NullPointerException
Is this a bug?
Thanks
Alex.
Hi,
We're getting the same error. Did you have any luck figuring it out?
Just curious. Is there anyway to automatically add labels to a news post when it is created? I want to use the blog post macro in a space to collect only a specific type of news item as indicated by a label. I realize I can have people add the label themselves, but I would really like to cut out the middle man.
Were you able to get an answer on this? I am trying to set the labels to a news post or pages that are created from a parent page. I have not been able to find a way to do this.
Looks like the following will help with this issue.
http://confluence.atlassian.com/display/CONFEXT/Automatically+label+news+post
Don't know how to get dynamic content for the label to work. Does anyone else?
Updated by Carrie Moley
Jun 12, 2007 18:56
I love the add-label macro, but some of our folks would like to have the template prompt users to choose a label from a list. I had hoped that I could combine the add-label macro with the form markup used in templates like this, but it doesn't work:
{add-label:solution,@customer|list(motorola,hp,sun)@,@category|list(constraints,assertions,debug,lrm_support,coverage,language)@}
Of course, we want the outcome to be a list of labels like "solution, motorola, coverage" so that people could search for content of type 'solution' for the 'Motorola' customer that addresses the 'coverage' subject matter.
Is there a workaround or alternative for this use model that I can try instead? Does anyone else want to choose labels from a predetermined list?
Thanks,
Carrie
I would like to be able to have users promted to choose from a list of labels. Has there been any additional info on this suggestion?
Hello
Great macro to get paged labeled automatically...but I desparetly try to get the value from a scaffold live-template list-data and can't get it to work...
{list-data:Type|type=check|multiple=false|required=true} {list-option}Website{list-option} {list-option}Application{list-option} {list-option}Other{list-option} {list-data} ... ... {add-label:{list-data:Type}}Any idea where I am wrong?
Thanks in advance
Serge
Hi,
We have the same problem. For some reason
Is the theme builder incompatible with the Scaffold macro?
We are using the latest version of both theme builder and Confluence.
Thanks,
Chris
No - it's a problem with scaffold plugin and the latest confluence (2.5 and above I think). Please check with the author of the scaffold plugin for more info.
Updated by Serge Wargnies
Aug 29, 2007 10:06
Hi,
Here a solution that as its author said is maybe not the most efficient but it works.
So I tried
And to get the add-label working...I was told to use replace-and-render...and the result looks like:
Hope this will help others.
Thanks anyway
Cheers
Updated by Dhivya Manoharan
Dec 19, 2007 10:43
Hi,
im using add-label macro.
Is there any way that only the certain group of people can both edit and view
the label. while other group of people can only view the label.
With Regards,
Dhivya.M
Confluence 2.9
The add-label macro works, but the choose-label macro does not seem to add the labels when I click on the links. Here is my wiki markup
{choose-label:labels=test|title=Please Choose...|descriptions=test} {choose-label}