Access Keys:
Skip to content (Access Key - 0)
Home (Access Key - 1)
All spaces... (Access Key - 3)
Log in (Access Key - 5)
Sign up (Access Key - 6)
Toggle Sidebar

add-label macro


{add-label} Macro

Examples

Hints and Tips

Use this macro in [USERGUIDE:Templates] and [USERGUIDE:Scaffold Templates] to automatically label pages created with those templates.

Frequently Asked Questions

None at present.

Toggle Sidebar

See Also

Incoming Links


Outgoing Links


Added by Alain Moran on Apr 10, 2006 00:38, last edited by Guy Fraser on Jul 21, 2008 19:06
Anonymous

Is it possible to add the support of adding dynamic content to label?
a example will be {add-label:{pageid}} in which the macro

Unknown macro: {pageid}
will generate the page id for that page. It will be very useful for us if it's possible. Thanks

I second this request. I need {add-label:{metadata-from:Random Page|randomValue}}...

Thanks for considering it!

Anonymous

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.

Anonymous

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!

Anonymous

I fixed this by the way in the 1.1. release of the labeltools plugin.

Kelsey Grant

Anonymous

The plugin seems to be broken on this page.

Anonymous

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

Anonymous

Hi there,

I'm using the 1.1. version of the labeltools plugin, and when I try to use the

Unknown macro: {add-label}
macro, I get:

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?

Anonymous

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

Unknown macro: {live-template}
does not seem to work, and right now we can't use any templates.

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

{list-data:Type\|type=select\|multiple=false\|required=true}
   {list-option}One{list-option}
   {list-option}Two{list-option}
   {list-option}Thre{list-option}
{list-data}

And to get the add-label working...I was told to use replace-and-render...and the result looks like:

{replace-and-render}
 {replace-item:%label%}{get-data:Type}{replace-item}
 {replace-body}{add-label:%label%}{replace-body}
{replace-and-render}

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}



Adaptavist Theme Builder Powered by Atlassian Confluence