Is there a user macro I can create that would allow users to click on it and it would have them watch for new blog posts in a space? I would like to put a button on my blog's home page that would allow them to watch all blog posts in the space?
The out of the box watch functionality when you click on "watch" on the home page does not allow you to just watch for new blogs. You can watch for all content, but we only want the blog notifications. Is this possible?
Hi @Heth Siemer
There are 2 options for you.
First option: Out of the box from confluence. Click on a space on the left the "Blog" link. then on the right you have the option, to "Watch the blog"
Second option:
I wrote a user macro:
## Macro title: Watch Blog Button
## Macro has a body: N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: Dominic
## Date created: 18.07.2019
## Installed by: Dominic
## This is an example macro
## @param spacetitle:title=Space Title|type=string|required=true|default= |desc=Den Titel, welcher im Button angezeigt wird
## @param spacekey:title=Space Key|type=string|required=true|default= |desc=Den Space Key von dem Space, welcher du abonnieren willst.
<button id="twtr-watch-space-blog" class="aui-button">Abonnieren den $paramspacetitle Blog</button>
<script>
AJS.toInit(function(){
AJS.$('#twtr-watch-space-blog').on('click', function(){
addBlogWatcher();
});
});
function addBlogWatcher(){
jQuery.ajax({
url: AJS.contextPath() + "/spaces/addspacenotification.action?contentType=blogpost&key=$paramspacekey&atl_token="+AJS.Meta.get('atl-token'),
success: function (xhr) {
AJS.$('#twtr-watch-space-blog').text('Du hast geraden den Blog abonniert.');
AJS.$('#twtr-watch-space-blog').attr('disabled','disabled');
}
});
}
</script>
Regards, Dominic
Howdy Dominic,
That user macro looks exactly like what I want, I'll definitely give it a shot! Thank you so so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dominic Lagger your solution worked really well during the last years 👍
Unfortunatly, in our instance, with the updated to Confluence 8.5.6 this user macro stopped working :(
Do you or another reader happen to know of an 8.5 compatible solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.