Pass Parameters to a Macro

Rick Wright November 30, 2020

Is it possible to set a page-level constant that I can pass as parameters to a set of macros on the page?

1 answer

0 votes
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.
November 30, 2020

Well the Cloud version does not support user macros. How were you planning on creating your macros?

Rick Wright November 30, 2020

Hi Bill, 
We have templates set up that use the standard /Content by Label Macro, a few times on each page.  Most of the filters in the template are static, but depending on the topic of the page we have to go into each Macro and change one of the filters to make it relevant to the page.  My objective here is to be able to change one constant on the page and have all the macros pick it up as a parameter.  

 

Does that make sense?

 

r

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.
December 1, 2020

I think so, and I think the only way to solve this is with a user macro, which are not available in the cloud version. Or you would have to write a plugin to do what you want (even more complex than a user macro).

Rick Wright December 1, 2020

Hi Bill,
Not sure I agree that the only way to solve this challenge is with a User Macro, as enabling the passing of a parameter to an inbuilt-macro could achieve what I am looking for.

I am new to Confluence, and only have experience with the Cloud solution, so I am not familiar with User Macros.  It wouldn't want to have to create and maintain our own macro to do everything the inbuilt one does, just adding this feature.

Many ways to skin this cat, but my objective is to reduce the effort associated with creating and maintaining pages.

 

r

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.
December 2, 2020

Well the issue is that if you want to do something server side, it depends on the storage data of the page. And the only two ways I know to do that is with user macros and plugins/apps.

On the client side (display view), you can interject Javascript, which is hard with the Cloud version (or is applied throughout the site). Again, an easy way to inject Javascript on a page is through a user macro. But that only impacts how the page is displayed and NOT its data.

For a complete listing of the differences. https://confluence.atlassian.com/cloud/compare-atlassian-cloud-vs-server-744721664.html 

Rick Wright December 2, 2020

Hi Bill,
You and I are obviously repressed techies, and are solutioning.  Maybe we need to go back to my requirement, which is really about minimising the effort to set up and maintain pages created from a template, where the template has a number of macros pulling content from other pages on the wiki.  Based on the topic of the page, filters in each macro needs to be modified so content relevant to the page is pulled. 

Sounds like Confluence Cloud doesn't have a solution for this at the moment - would be wonderful if it was considered as a value-add enhancement.

r

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.
December 4, 2020

Yes, the Cloud version is very restrictive when it comes to this sort of customization, plus they may push out an update that breaks what you have set up. This is why I recommend the server version (but they are forcing customer to the much more expensive Data Center).

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events