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

2 votes
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.

1 vote

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,788 views 26 10
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