Been trying to call a PocketQuery query from within a User macro, just can't get to work
The reason why I want to use a User macro is because I can't parse all the parameters to the query automatically using the standard interface.
Hi Anders,
Thank you for using PocketQuery!
What have you tried so far and what does not work for you?
You should be able to render any PocketQuery macro within a user macro by adding its storage format. A basic pocketquery macro could look like this in storage format:
<ac:structured-macro ac:name="pocketquery" ac:schema-version="1"><ac:parameter ac:name="name">MyQuery</ac:parameter></ac:structured-macro>
You can also set parameters this way. If you need an example, go to a Confluence page where your PocketQuery macro is set, click on the three point icon on the top right and select "View storage format". Then you can copy the relevant section from there to your user macro and adjust what you need to.
Hope this helps!
Best regards
Carla
P.S.: The fastest way to reach us at Scandio is usually through our service desk, if you need immediate support.
Hi Carla,
Thank you for the quick reply.
I have tried using the same syntax, but didn't include all the right parameters, that why it didn't work :)
Is it possible to call to call the pocketquery macro in a button like below
<button class="aui-button" onclick="$PocketQuery .....
Just as an info (properbly obvious) I'm all new to Confluence and the way the plugins works.
Regards
Anders
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anders,
Happy to hear my answer helped :) If you officially "accept" it, others can see that the questions is solved.
Some general info: The code you include in the user macro simply executes the macro and adds the resulting HTML to the page. So executing it on button click is not possible this way.
There is a way to include the PocketQuery macro dynamically, though, using the option "Dynamic load" and "Dynamic parameters" (find more here in the documentation). Depending on what you want to achieve, you will also need a custom PocketQuery template (see more here and in our Getting Started Guide and Templating Tutorial). I think the easiest way would be to manage the dynamic behaviour using these PocketQuery mechanisms and maybe some custom Javascript in your user macro.
Regards
Carla
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carla
Thank you for your help. I'll try your suggestion.
Regards
Anders
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.