Can connect two macros to one?
Asked by Tony Montana:

Hi there! Can I connect two macros to one button? For example.

For example. I need to add an Expand macro and inside the Noformat macro in one action. Is it possible?


Answers:
author: WW
body: Adding an Expand macro inside of a No Format macro wouldn't work since the No Format macro would take away anything but text that's in the macro's body.

In fact, Confluence won't even let you add the Expand macro inside the No Format macro.

For this kind of thing, you don't really need to ask a question to the Community for, though, because it's very easy to test on a Confluence page, and you'd have your answer in \<1 min.

comments: author: Tony Montana
body: [@WW](/t5/user/viewprofilepage/user-id/1209024) facepalm)))) I want to add NO FORMAT to Expand macro, not expand to no format :DDD WTF this scooby di)))


author: WW
body: I'm not sure exactly what you meant by all of that and if you're saying you were at fault in your question or that I misunderstood you. From what I read, you wanted to put the Expand macro inside of the No Format macro.

All you have to do is put the No Format macro inside of the Expand macro.

I'm not sure what you mean by using buttons to put a macro inside of a macro. If you mean you want a pre-packaged macro, then [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089) is correct, you'd need to customize something.

Confluence doesn't so what you want it to do out of the box since there could be millions of combinations of nested macros.

If you don't want to write your own user macro and you use those two macros all the time, then I recommend copying and pasting. That's about all you can do since this is not a built-in feature of Confluence.


author: Bill Bailey
body: Typically that option is referred to as nesting. And yes you can nest macros inside of other macros generally. There may be times when some functionality is lost, but your example should work without any issues.

comments: author: Tony Montana
body: Thank you for answer. Can you tell me more about "nesting",


author: Bill Bailey
body: Placing one or more macros inside another is referred to nesting. Like an egg inside a bird's nest.


author: Tony Montana
body: [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089)Thank you. And, how can I place 2 macros clicking by 1 button?


author: Bill Bailey
body: Not sure what you mean with one button. The proceedure is you need to insert the parent macro on the page first, then place/insert the nested macro inside the parent macro.


author: Tony Montana
body: [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089) I want to do two things for the price of one, you know?


author: Bill Bailey
body: Sorry Viktar, still not clear what you want to do. Nesting of macros is the way to go. OR if you want something more complex withing a single macro, then you need to write a uer macro. There you have much more control.


author: Tony Montana
body: [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089) Do you know automation? Why press two macros all the time when you can press one macro or button and get the result with two macros per page?


author: Bill Bailey
body: Sure, then what you want to do is to write a user macro to do what you want. Take a look at this article I wrote to get you started:

[Getting-Started-with-User-Macros-Writing-a-Wrapper-Macro](https://community.atlassian.com/t5/Confluence-articles/Getting-Started-with-User-Macros-Writing-a-Wrapper-Macro/ba-p/979571)


author: Tony Montana
body: [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089) Yeah , Apparently, becoming a developer is the only way to solve my problems :) Thanks for trying to help


Tags: confluence-server

nest

server