Skip to end of metadata
Go to start of metadata

ThemeBuilder Macro - Create Child

create-child

Creates child pages using a macro.

 

Categories: confluence-content

Usage

There is no visible content when used a in page. When the page is saved a new child page is created. This macro is useful for automatically generating hierarchies from templates.

Basic:

User creates a new page using a template that has a 'create-child' macro in place. With the option 'render' set, that first template will actually generate two pages: one parent and one child.

  • Parent
    • Child

Advanced:

The new page is called Colours and the template contains 5 'create-child' macros, each with a different page title: Red, Blue, Green, Yellow, Purple. The resulting pages will be:

  • Colours (parent)
  • Red
  • Blue
  • Green
  • Yellow
  • Purple


Storage Format

<ac:macro ac:name="create-child">
   <ac:parameter ac:name="parameter">value</ac:parameter>
</ac:macro> 

Wiki Markup

{create-child:parameter=value}

Parameter

Name

Description

Type

Default

Required

pagetitle

Page Title

The page title that should be used for the created page

string

 

(tick)

parent

Parent Page

The page where the child should be created, defaults to the current page

Possible values:

  • SPACEKEY:pagename - a specific page in a specific space
  • pagename - a specific page in the current space
  • @self - the current page
  • @current - same as @self
  • @parent - the parent of the current page
  • @parentparent - the parent of the current page's parent
  • @orphan - as an orphaned page in the current space
  • @space - same as @orphan
  • @root - the root of the current page's tree
  • @home - the homepage of currently viewed space

confluence-content

@self

(error)

once

Only Once

Only create the page once, if the page gets deleted, do not attempt to re-create it.

boolean

false

(error)

template

Template

The template to use when creating the page (may be a space or global template, or a skin resource)

Possible values:

  • LAYOUTID::resource.ext - a resource in a specific layout
  • @current::resource.ext - a resource in the current layout
  • @parent::resource.ext - a resource in the current layouts parent
  • SPACEKEY:pagename - a specific page in a specific space
  • @current:pagename - a specific page in the current space
  • pagename - a specific page in the current space §
  • templatename - the name of a space or global template §

§ The pagename/templatename selectors are actually routing through a series of fall-back situations, the source for the template will first be checked against any editable-text objects with that name in the current space, then global editable-text, followed by a page in the current space with that name, then a space-template in the current space, after that a global template will be looked for and finally a builder resource with one of the extensions (.xml/.hxtml/raw/html/wiki) will be looked for and rendered appropriately dependant on the resource's extension.

NB: Confluence 'blueprints' (eg: Meeting Notes) are not accessible through the template parameter.

string

 

(error)

render

Render

Whether to render the resultant page or not (so that create-child macros in the template can be executed)

boolean

false

(error)

flag

Flag

A list of flags, one of which must be defined for the content to be displayed

string

 

(error)

notflag

Not Flag

A list of flags which must not be defined for the content to be displayed

string

 

(error)

 

Example

Create a child page called 'Child'.

<ac:macro ac:name="create-child">
   <ac:parameter ac:name="pagetitle">Child</ac:parameter>
</ac:macro> 
{create-child:pagetitle=Child}

Result