Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How add space parameter to Content by User macro

boardtc
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2018

The Content by User macro says you can filter by Space in the documentation:

{content-by-user:author=jsmith|spaceKey=all|max=25}

From Confluence Wiki Markup Using Insert | Markup and adding above gives:

contentmacro.pngHowever, I can include the macro using the WYSIWYG and it shows fine specifying the author but for all the spaces and I just want to restrict to the current space.

Trying with Markup of:

{content-by-user:author=jsmith}

Gives the same errror of "no pages at the moment" also. What am I missing, why is the markup not working?

 

1 answer

1 accepted

1 vote
Answer accepted
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2018

The associated tag says server, but you doc link you sent was for cloud. The server version does not have the ability to screen for space. And I think that the doc you are looking at is out of date regarding the wiki markup (it is slated for deprecation), for example, that sample does not appear on the server docs.

boardtc
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2018

Good spot. The corresponding documentation for our server version confirms that the server version does not support space in the Markup. Atlassian have a smelly code base that they have to code twice to add functionality in the cloud & server versions.

Thats said the markup for the author does not work either, which is a bug. But that does not help me.

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2018

Check the user name (differs from the display name). Also try other user names (for example if there was a change in user directories, could cause none to appear).

I tried on my Instance 5.10.x, inserting the markup into the wiki markup macro, and it worked as expected.

But generally, this is a situation where you will need to create a user macro to do what you want.

boardtc
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2018

I didn't know I could create a custom macro to do the likes of this, can you point me to any resource, please?

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2018

Sure, the first part is to start with the user docs:

https://confluence.atlassian.com/conf610/user-macro-template-syntax-952622979.html

But you will have to do research from there, looking at complex examples of macros plus the Confluence API docs to find what available objects and methods are available.

Here is an example of a complex macro with good tips and hints:

https://github.com/unidwell/confluence-include-child-pages-macro

There are also some articles here, they can give you tips and hints:

https://community.atlassian.com/t5/tag/user-macro/tg-p/interaction-style/blog

So lots of googling to get started, some basic knowledge of VTL, and familiarity with the concept of Java objects and methods. I knew none of this when I started FYI.

User macros are very powerful and allow you to fill holes in Confluences.

 

Good luck!

boardtc
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2018

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events