Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Jiten Yagnik November 19, 2015

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
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.
November 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
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 20, 2015

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
TAGS
AUG Leaders

Atlassian Community Events