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

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}

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.

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.

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.

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted an hour ago in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

8 views 0 1
Join discussion

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