How to faster select macro parameters?

Arnold Späing January 16, 2014

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

4 votes
Answer accepted
Arnold Späing January 19, 2014

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}

1 vote
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
January 16, 2014

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

Arnold Späing January 16, 2014

Unfortunately not working on Confluence 5.1.5 :-(

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
January 16, 2014

Sorry, you need to close with }

Arnold Späing January 19, 2014

Thanks Bob, that guides me to the correct solution:

You have to type

{code:language=bash}

in order to autocreate the macro.

1 vote
Mick Davidson
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.
January 16, 2014

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.

0 votes
Matthew J. Horn
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.
January 16, 2014

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.

0 votes
Arnold Späing January 16, 2014

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.

Mick Davidson
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.
January 16, 2014

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events