I have been using this kind of URL links with previous versions of Confluence:
.../wiki/pages/createblogpost.action?spaceKey=space&labelsString=label |
It seems that the labels parameters are not passed on for the blog post at all anymore.
Is there any way to get this working with Confluence 4.0?
This should still work in Confluence 4.0 with the parameter labelsString, it works at least in our environment. They won't be displayed in the label editor, but they will be added to the page/blogpost after saving.
I'm not sure whether this is a bug or a feature. You can pass multiple labels with labelsString=test1,test2 and then even add a third label (for example: label3) in the editor. Confluence will add all three labels to the page/blogpost. I can think of some use cases where hiding those passed labels would make sense.
Hope this helps
Remo, thanks a lot! This resolves my issue completely. It is actually even BETTER that the label parameters passed over in URL are not shown in label editor (the user cannot remove them...).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exactly, that's the use case I was thinking about. I'm glad that this resolves your issue!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
&labelsString=label doesn't work in 4.3
or should I still insert the script code for it to work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It still works, without any script code. Just use the following url:
http://path.to.your.confluence/pages/createblogpost.action?spaceKey=TEST&labelsString=label1,label2
Note that the labels are not displayed in the editor during the creation of the blogpost. But they will be visible after saving.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I actually tested that for several minutes before posting my initial reply.
I didn't insert the code through the admin panel.
I use the abovementiond url with corrections to my server url and spacekey, it doesn't show the labels in the labels and it doesn't show them after I publish the post either...
I also tried the user macro to do that that is in the user macro repository or something here on Atlassian website, it also doesn't add the labels.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Strange, I just successfully tested it in three different Confluence instances with different users and different permissions. Can you confirm that you are able to add a label to a blogpost over the default UI?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, sure I can add labels. I even use links on my webpages that create _pages_ in a specified space and with a specified template, that works fine, confirming it's not a browser issue (stripping redirects or whatever).
I'm using a standalone Confluence 4.3. The only code I added to the Custom HTML is the javascript to swicth off Notify watchers.
Are there any other parameters I could test with the createblopost.action to make sure they pass or not?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are other parameters like spaceKey, but I'm sure they'll work. Sorry, don't really know what to do here, maybe check the log for any errors or contact Atlassian support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Remo, sorry I was incorrect.
Indeed it works and passes labels on blog creation. Don't know why it didn't work for me yesterday evening, but it does today's morning.:) I'm planning to add some convenient buttons with those links.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes you can do this with a little bit of javascript. Insert the following code to your Administration > Custom HTML > "At the end of the BODY"-part
<script type="text/javascript"> AJS.toInit(function ($) { //is it a create page action which is called?? if( window.location.href.indexOf("createpage.action") > -1 || window.location.href.indexOf("createblogpost.action")) { //if yes is there a label given as request parameter??? var label = getUrlVars()["labelsString"]; if(label) { //simply click the labeleditbutton jQuery("#rte-button-labels").trigger("click"); //insert the label parameter value jQuery("#labelsString").val(label); //and close the label editor jQuery("#add-labels-editor-button").trigger("click"); jQuery(".dialog-button-panel a.button-panel-cancel-link").trigger("click"); } } }); //this function is needed to get the parameters from the url function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } </script><br><br>
Now you can use your "labelsString" Parameter. Don't forget to clear your browser cache with Ctrl+R. Testet with my Confluence 4.0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like the URL method is broken again (Confluence 5.9.3).
Sandro, your solution works perfectly for me (thank you!), but the labels window remains open after clicking the link.
I tried changing ".dialog-button-panel a.button-panel-cancel-link" to a couple of different things, but nothing I tried worked.
Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We experience the same problems with the url method in5.9.4. Anyone any ideas how to solve it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
see https://jira.atlassian.com/browse/CONF-37848
A solutiion that fixes the url method is installing the recently published free Bitvoodoo add-on Label Fixer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.