How do you create a macro to simply add pre-written text to a confluence page when in edit mode?

I need a way to be able to add some pre-written text to a confluence page when editing. 

 

My company often lists certain tasks with different bits of information and they want a way to be able to simply insert a template of text so that they only have to fill in the missing information, rather than copy and paste from previous tasks.

 

It seems like a really simple issue, but i'm struggling to find a solution. I'm assuming creating a macro is the right answer. Feel free to tell me I'm wrong!

Thanks in advance for any answers

2 answers

This widget could not be displayed.
Stephen Deutsch Community Champion Nov 20, 2015

Do you need something different from the built in template functionality?  Confluence allows you to create templates which have pre-defined text in the page, and then you can have people edit this pre-defined text.  You can even set variables so people fill it in like a form.

Here is some more information:

https://confluence.atlassian.com/doc/create-a-page-from-a-template-296093793.html

If you want just one section to be pre-defined, then that is a different story.

This widget could not be displayed.

There's a couple of approaches, but there's a distinction we need to clarify.

When you add this macro, do you expect it to create a set of pre-set text and then remove itself?  Or should it remain as a macro on the page which always displays the pre-set text when the page is viewed?

If it's the first, there's not actually a lot you can do - macros are mostly supposed to run when a page is viewed.  There are some options when first creating a page, but the best place to look is the add-ons in the marketplace.

If it's the second, then it's easy, and you have options

  1. Use the include macro to include the content of a page you keep (read-only) elsewhere
  2. Write a macro add-on to display your text (I wouldn't bother with this, given 1 and 3, I mention it for completeness only)
  3. Write a "user macro" that displays the text you need

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

208 views 2 4
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