Global Template Development from existing Confluence page

Craig Hylwa March 22, 2012

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?

3 answers

0 votes
Davide Schillaci
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 12, 2018

Hi Craig,


actually it isn't simple to create a Global Page Template from an existing Confluence page, given only the out of the box features, and developing it might be complicated. That is why we have developed Simply Templates: https://marketplace.atlassian.com/apps/1219191/simply-templates?hosting=server&tab=overview, in order to facilitate the creation of global page templates, in case one is a system administrator, space templates for spaces one is the administrator of, and more. In case of interest, check it out. Cheers!

Davide

0 votes
Andrew Frayling
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.
March 30, 2012

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.

0 votes
Andrew Frayling
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.
March 22, 2012

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.

Craig Hylwa March 22, 2012

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

Craig Hylwa March 22, 2012

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

Andrew Frayling
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.
March 22, 2012

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events