Description
Automatically labels news post items by the desired label (or labels).
Detailed Description
Automatically labels news post items by the desired label or labels.In this way,you can expose a link such as "Add post" on a page hiding the label, and when the user clicks on this link and posts news, the label will be automatically attached to the post.This is beneficial for users to distinguish news items by the label names.The user really doesn't have to worry about labeling a news item while posting the news.
Installation
To install the macro:
- go to Administration -> User Macros
- create a new user macro called addpostbylabel
- Enter the following in the Template field:
#set ($wikibaseurl = "${req.getContextPath()}")
<a href='$wikibaseurl/pages/createblogpost.action?spaceKey=$space.key&labelsString=$param0'>Add Post...</a>
Usage
{addpostbylabel:desiredlabel}
Examples
{addpostbylabel:javanews}
{addpostbylabel:javanews,ganglia,wily}

Comments (9)
Apr 07, 2008
Nicholas Kerzman says:
Pranav, Thanks for this user macro. With the macro can you specify more then on...Pranav,
Thanks for this user macro. With the macro can you specify more then one label to add? For example:
{addpostbylabel:label-one, label-two}On a side note, this macro is a nice interim addition to news. Ultimately it would be nice to see Atlassian add template capability to news posts. Please vote for and comment on this feature request here: CONF-4174
Thanks again.
Apr 07, 2008
Pranav Olkar says:
please see my comment below :Thanks for this question I have voted for the feat...please see my comment below :Thanks for this question
I have voted for the feature you specified, surely looking for it !
Apr 07, 2008
Pranav Olkar says:
Hey Nicholas, absolutely no changes required in the code (Why didn't I notice th...Hey Nicholas, absolutely no changes required in the code (Why didn't I notice that in the first place ? )
You can just go on typing comma separated lables.
e.g
{addpostbylabel:java,dotnet,spring,hibernate}Cheers,
Pranav
Apr 07, 2008
Pranav Olkar says:
Thanks for you question, Nicholas ! I have made changes to the description n...Thanks for you question, Nicholas ! I have made changes to the description now,specifying that the macro can take multiple labels too
Apr 08, 2008
Nicholas Kerzman says:
Thanks, sounds great. Had a feeling that was the case but hadn't actually had a ...Thanks, sounds great. Had a feeling that was the case but hadn't actually had a chance to implement and test it yet. Thanks for updating the doc.
Apr 24, 2008
Jose Biton says:
This is great! Without knowing how to create macros I'd been trying to figure ou...This is great! Without knowing how to create macros I'd been trying to figure out how to do this for a while.
Is there an easy way to tweak the macro such that the text can be dynamic. For example:
{addpostbylabel:desiredlabel}Dynamic Text{addpostbylabel}It would be very helpful. Thanks.
Apr 29, 2008
Pranav Olkar says:
Hi Jose, as the text on a page is not stored in the URL parameters, it is not po...Hi Jose, as the text on a page is not stored in the URL parameters, it is not possible to provide this functionality to this macro.
Oct 24
Brian M. Thomas says:
Pranav: I think (hope) you misunderstood him. I think that what he meant was t...Pranav:
I think (hope) you misunderstood him. I think that what he meant was to change the link text, which is not part of the URL but the link as presented.
If so, the answer is yes: Instead of fixed text ("Add post..." in your example), put $body between the opening and closing <a> tags. Of course, you must check the Macro has a body box on the edit macro form.
yesterday at 17:59:58
Pranav Olkar says:
I guess so, Brian. Thanks for the solutionI guess so, Brian. Thanks for the solution