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

(Blueprint) Page template with child pages

Rui Rodrigues
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.
December 17, 2014

Hi there,

I'm creating a blueprint plugin module and I need create a page from a template with and 2 child pages need to be created.

Example:

Main Page (Page being created)

  • Child page A
  • Child page B

Someone can help me please?

Thanks,

RMRodrigues.

 

5 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Eduardo Guzman December 17, 2014

Following the blueprint tutorial (https://developer.atlassian.com/display/CONFDEV/Write+a+simple+Confluence+Space+Blueprint) you have to change the atlassian-plugin.xml:

...
<space-blueprint key="first-space-blueprint" i18n-name-key="confluence.first.space.blueprint.name">
        <content-template ref="hierarchy-blueprint-content-template"> <!-- Home -->
            <content-template ref="hierarchy-child-a-content-template"> <!-- Main Page -->
                <content-template ref="hierarchy-child-child-a-content-template"/> <!-- 1st child -->
                <content-template ref="hierarchy-child-child-b-content-template"/> <!-- 2nd child -->
                <content-template ref="hierarchy-child-child-c-content-template"/> <!-- 3rd child -->
            </content-template> <!-- End of Main Page -->
        </content-template> <!-- End of Home -->

All pages are just content-template unless you want to be able to use them later too.

 

0 votes
Pascal Beaudry December 17, 2017

Hi Rui,

           If you also have a Jira instance, you could use one of the 2 following product to create a Page Tree Template in Confluence:

Using those tools, you could export a Space or a Page Tree Template. You could add macro and parameter that will be use during the instanciation.

0 votes
EPS Software Engineering AG
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.
June 11, 2016

Hi,

For those who do not want to get into the Java programming. Try our Page Tree Creator Add-on.

Our Add-on Page Tree Creator works a bit different than the Confluence blueprints / templates. The PTC-templates are based on normal confluence pages and therefore creating a PTC-template is as simple as creating a Confluence page. Of course you could start creating your PTC-blueprint based on an existing Confluence page.

Try our Live Examples (no registration needed).

Marketplace link: Page Tree Creator.

Regards,
Stephan

0 votes
mitesh February 5, 2015

I am trying this and i cant make a template with default pages

 

does anyone know what is wrong with this. 

<space-blueprint key="example-space-blueprint" i18n-name-key="confluence.blueprints.space.example.name">
<content-template ref="example-space-homepage-template">

<content-template ref="example-child-a-content-template"> <!-- Main Page -->

</content-template>
</content-template>
<dialog-wizard key="example-space-blueprint-wizard">
<dialog-page id="exampleSpaceId"
template-key="Confluence.SpaceBlueprints.Example.dialogForm"
title-key="confluence.blueprints.space.example.dialog.create.title"
description-header-key="confluence.blueprints.space.example.dialog.create.heading"
description-content-key="confluence.blueprints.space.example.dialog.create.description"
last="true"/>
</dialog-wizard>


</space-blueprint>

Irakli Edjibia June 7, 2017

Hi mitesh,

do u have managed do make this work by now ?
I'm trying to achieve pretty much the same ^^
I need a space Blueprint with mutliple pages inside and i can't get things to work.

this is my space blueprint tag:

 <space-blueprint key="example-space-blueprint" i18n-name-key="confluence.blueprints.space.example.name">
        <content-template ref="example-space-homepage-template">
            <content-template ref="example-space-childpage-template"/>
        </content-template>
        <dialog-wizard key="example-space-blueprint-wizard">
            <dialog-page id="exampleSpaceId"
                         template-key="Confluence.SpaceBlueprints.Example.dialogForm"
                         title-key="confluence.blueprints.space.example.dialog.create.title"
                         description-header-key="confluence.blueprints.space.example.dialog.create.heading"
                         description-content-key="confluence.blueprints.space.example.dialog.create.description"
                         last="true"/>
        </dialog-wizard>
    </space-blueprint>

and then i have the followig content template tags:

 <content-template key="example-space-homepage-template" i18n-name-key="confluence.blueprints.space.example.homepage.name">
        <description key="confluence.blueprints.space.example.homepage.desc"/>
        <resource name="template" type="download" location="/xml/example-space-home.xml"/>
    </content-template>


    <content-template key="example-space-childpage-template" il8n-name-key="confluence.blueprints.space.example.childpage.name">
        <description key="confluence.blueprints.space.example.childpage.desc"/>
        <resource name="template" type="download" location="/xml/example-child-page.xml"/>
    </content-template>

When i create the a space with my Blueprint i the space home page is generated but no other child pages.

Any idea what i'm doing wrong there?
best regards Irakli

Aaqib Khorasi August 16, 2017

Hello Irakli,

Just wanted to follow up with you regarding the above concern. I am stucked with the same problem and I am trying to achieve same thing. Did you find a way out for it?

 

Thanks,

Aaqib

0 votes
Yagnesh Bhat
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.
December 17, 2014

Hi Rui,

 

For creating two child pages, I guess you can try creating the pages using Java API in the blueprints contextprovider's updateBlueprintContext method, as that one does get called when the blueprint renders.

Rui Rodrigues
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.
December 17, 2014

How I can create a page from JAVA API?

Yagnesh Bhat
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.
December 19, 2014

Well, you can create an object of type Page in the method mentioned in my answer, using the API reference for Confluence depending on version of confluence you are using. Ref: https://docs.atlassian.com/atlassian-confluence/latest/

Yagnesh Bhat
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.
December 19, 2014

I guess you can also try Eduardo's approach too ....

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events