Along with Confluence templates for sprint planning, retrospectives, and Go-No-Go decisions, we have checklist templates for routine maintenance, rolling new versions, and even rolling out the next seasonal release.
With Confluence, you can also create any number of specialized spaces, to help organize your content. Given our love of checklists and other artifacts, to keep our spaces from overflowing, we standup a new workspace every four months, to cover each seasonal release (Winter, Spring, and Summer).
Confluence templates can be associated with a space, or setup as global templates available to all the spaces. For our seasonal workspaces, the Confluence global templates come in handy, since we can access a global template from any workspace in our site.
While Confluence is a outstanding enterprise wiki, with finely grained permissions, there is a gap when it comes to global templates. To create and edit global templates, you have to be a site-wide administrator. This is a sad gap for us, since we like to keep our checklist templates open for collaborative editing.
Ideally, we’d be able to setup a dedicated space to store shared templates, protected with the usual Confluence permissions.
A handy feature of global templates is that you can attach them to a button and save the new page back to your current space. With a bit of tinkering, I found a link that can create a template defined in another space.
Here, the other space is named “TEMPLATES” and Entity ID is a page key.
/wiki/pages/createpage-entervariables.action?templateId=ENTITY_ID&spaceKey=TEMPLATES&title=&newSpaceKey=TEMPLATES
You might think that “newSpaceKey” could direct the new page to another site: Alas, it does not. For now, it has to be the same space as the spaceKey, or Confluence complains in no uncertain terms.
While this link does create the template, it doesn’t save the new page back to your current space. The new page ends up in the space where the template is defined.
After clicking the link, an easy workaround is to leverage the Confluence user interface, and in a few quick clicks, move the page back to your current space.
Here’s the work instruction.
Add a new page from template link
- Click on a custom Add link to create a new page based on the template.
- On the new page, click on the (Location) icon next to the page title.
- In the left-side bar, click “Recently Viewed”, then select the first page listed (where you just clicked the link), and click Move.
- Enter the page title and make any other immediate changes. Save the new page.
- The new page is saved as a child of the page where you clicked the link.
- Here’s how to setup the custom link to a shared template space. First, we create the template, and then we create a link to the template.
Create a new Shared Template
In whatever space you want to use for shared templates:
- Click the (Space Tools) button in the sidebar.
- Select Content Tools.
- From the Templates tab, create a template to be shared with other spaces.
Link to a Shared Template
- Edit the template and from the page URL, obtain the entityId (a numeric code).
- Example: /wiki/pages/templates2/viewpagetemplate.action?entityId=123456789&key=123456789
- (“TEMPLATES” is the name of whatever space you are using.)
- Go to the page where you’d like to create the template regularly.
- Insert a link referencing the entityId:
- wiki/pages/createpage-entervariables.action?templateId=123456789&spaceKey=TEMPLATES&title=&newSpaceKey=TEMPLATES
- For “123456789” use the entityId value from the prior step.
- Save the page
But, wait, there’s more!
An added benefit is that now you have easy-to-access examples of your templates. You can’t link everyone to a global template in Confluence, but if the template is in an shared space, you can link directly to the shared template. Very handy for procedural documentation.
If you need more people to update shared templates, or if you want to link to the current version of a shared template, then this Confluence hack is for you.
Do you have a favorite Confluence hack to share?