Pass Parameters to a Macro
Asked by Rick Wright:

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


Answers:
author: Bill Bailey
body: Well the Cloud version does not support user macros. How were you planning on creating your macros?

comments: author: Rick Wright
body: 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


author: Bill Bailey
body: 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).


author: Rick Wright
body: 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


author: Bill Bailey
body: 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](https://developer.atlassian.com/platform/forge/).

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>


author: Rick Wright
body: 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


author: Bill Bailey
body: 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).


Tags: cloud

confluence-cloud