Global Template Development from existing Confluence page

What is the most convenient way to create a global template from an already existing page. The page contains many macros and formatting. To code it by hand will take alot of time. Is there a way to exract and copy the already existing code?

2 answers

This widget could not be displayed.

Hi Craig,

Which version of Confluence are you using?

If you're on 3.x then you can just select Tools -> View Source on the page that you want to use for the template and copy and paste the macro source into the global template.

If you're on 4.x then things are a bit trickier as the page will use the new XHTML storage format, but you have to use the old wiki markup in the global template. You can view the XHTML storage format source of a Confluence 4.x page by selecting Tools -> View Storage Format, but you then have to convert the XHTML format to the old wiki markup. E.g.

The {info} macro in Confluence 4.x:

<ac:macro ac:name="info">
  <ac:parameter ac:name="title">Hello World</ac:parameter>
  <ac:rich-text-body>
    <p>Well, hello.</p>
  </ac:rich-text-body>
</ac:macro>

would need to be converted to the following in Confluence 3.x:

{info:title=Hello World}
Well, hello.
{info}

As far as I'm aware there's no automated way of carrying out this conversion, you'd need to piece it together with the docs for 4.x (http://confluence.atlassian.com/display/DOC/Confluence+Storage+Format) and the docs for 3.x (http://confluence.atlassian.com/display/CONF35/Confluence+Notation+Guide+Overview) to fill in the blanks.

So if you're on 3.x it's very straightforward, but if you're on 4.x it's a bit of a pain.

Hope that's of some help?

Andrew.

Using Confluence 4.1 and have roughly 25 individual templates to create for corporate documentation project.

Using Confluence 4.1 and have roughly 25 individual templates to create for corporate documentation project sh%#!

Sorry, looks like you'll need to use the more complicated way :-(

That said, it shouldn't be *too* complicated. The way I would go about this would be to use Tools -> View Source to give me the general outline of the page with Tools -> View Storage Format to give me the macro details. Using the source you should be able to put together the general outline in wiki markup fairly quickly and then use the Storage Format and the docs to fill in the macro parameters.

Sorry again, it was a huge oversight Atlassian not having the new format across all Confluence features when they dropped markup from the editor.

Not that it helps you right now, but you may want to vote for https://jira.atlassian.com/browse/CONF-11744 which is the feature request to allow XHTML/Rich Text format with global templates. Your use case also provides a concrete example of the pain that customers are having to go through due to the lack of consistency.

This widget could not be displayed.

Hi Craig,

Possibly a little late for your corporate documentation project, but have a look at the answer posted at https://answers.atlassian.com/questions/42585/how-to-use-image-effects-in-a-confluence-template for a workaround which may work for you.

Sorry if it's too late, but might be worth bearing in mind.

Andrew.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday 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...

258 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