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

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.

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

666 views 21 11
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