---
title: "How to create pages from template pages - self service"
canonical: "https://support.appfire.com/space/SUPPORT/89147103/How%20to%20create%20pages%20from%20template%20pages%20-%20self%20service"
format: markdown
---
> Macro (section)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

### <span style="color: #000000">Example - user dialog to create a standard personal space</span>

- Run macro provides a simple user dialog
- CLI macro body is virtually the same as the example script from [How to create pages from template pages](https://appfire.atlassian.net/wiki/spaces/SUPPORT/pages/89147778)


![image](media://267ac33d-eeb9-411d-aba7-8fdb8a78b40b)

#### Source for copy/paste convenience

##### **CLI macro body**

```
--action run --continue --findReplace "@userId@:$user,@managerId@:$manager"
 
@DATA:
--action addSpace --userId @userId@

# add admin permission for the user to their own space
--action addpermissions --space "~@userId@" --permissions "SETSPACEPERMISSIONS" --userId @userId@

# add space permissions to allow general user access to personal space
--action addPermissions --space "~@userId@" --group confluence-users --permissions "VIEWSPACE, COMMENT"

# add space permissions to all manager more access
--action addPermissions --space "~@userId@" --userId @managerId@ --permissions "VIEWSPACE, EDITSPACE, EXPORTPAGE, SETPAGEPERMISSIONS, REMOVEPAGE, COMMENT, REMOVECOMMENT, CREATEATTACHMENT, REMOVEATTACHMENT, EXPORTSPACE"

# add pages by copying template pages
--action copyPage --space templateSpace --title @home           --newSpace "~@userId@" --descendents --replace --noConvert
--action copyPage --space templateSpace --title "Public stuff"  --newSpace "~@userId@" --descendents --parent @home --replace --noConvert
--action copyPage --space templateSpace --title "Private stuff" --newSpace "~@userId@" --descendents --parent @home --replace --noConvert
--action copyPage --space templateSpace --title "Manager stuff" --newSpace "~@userId@" --descendents --parent @home --replace --noConvert

# add page permission to protect private section
--action addPermissions --space "~@userId@" --title "Private stuff" --permissions "view, edit" --userId @userId@

# add page permission to protect manager section
--action addPermissions --space "~@userId@" --title "Manager stuff" --permissions "view" --userId @userId@
--action addPermissions --space "~@userId@" --title "Manager stuff" --permissions "view, edit" --userId @managerId@ 
```