How to faster select macro parameters?

Is it possible to define user-define default parameter for macros?

How can use faster select a macro parameter without clicking the UI?

Use case:

A user frequently uses the "Cod block" macro. He always sets the "Syntax Highlighting" parameter to "Bash". But this always needs several clicks. The user wishes to get his macro prepared more easily and faster.

5 answers

1 accepted

This widget could not be displayed.

Based on the discussion before, the following solution can be suggested; thanks to all contibutors:

You can set macro parameters while typing in the wiki editor. Just type

{macro name:parameter name=parameter value}

for example

{code:language=bash}

This widget could not be displayed.

Arnold,

I don't know how to do this programatically, but you could create a page that contains all the macros you want to use, and set up their parameters as required.

Then all you have to do is copy and paste them into the pages where you need them.

You might have to change one or two parameters to suit the page, but you could cut out quite a lot of the work.

Cheers.

This widget could not be displayed.

Dare I say: use wiki and Insert markup. :)

More seriously, for this particular case they can just type: {code:bash} and it will auto-create

Unfortunately not working on Confluence 5.1.5 :-(

Sorry, you need to close with }

Thanks Bob, that guides me to the correct solution:

You have to type

{code:language=bash}

in order to autocreate the macro.

This widget could not be displayed.

Thanks, Mick. That's an option indeed. However, not the most covenient (that means fast) solution.

I thought more about some settings, autocomplete, keyboard shortcuts or the like.

No worries. :) As far as I know there isn't any way you can do these things from the keyboard. it might be possible to edit a macro so that it has several defaults automatically, but I wouldn't know how to do that.

It'd be good to find out though.

Cheers.

This widget could not be displayed.

Another possible approach is to write a User Macro that embeds the macro you want to use. You can pass params to it and possibly set defaults... I haven't looked into it yet, but I might give this a try.

And the nuclear option, of course, is to write your own user macro and set your params, but emulating existing ones can be especially hard with some of them.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published yesterday in Confluence

Add-on evaluation with confluence templates

Atlassian market place contains number of Apps/Addons which improves the capability of out of the box Atlassian products. It is good to follow a plugin evaluation process before install add-ons. So t...

33 views 5 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you