Automatically create/add a page

Hi,

I have several templates to make it easier for users to add stuctured content.

I want to also add unstructured content to the created pages, but wish to do this by automatically creating/adding a child page to the one renderd through the template.

USE CASE:

A user clicks a link that takes him/her to a template form; this will create a new page in that space. (done this bit).

So, when finished, the user clicks 'Save' and the form creates a new page. IN ADDITION, a child page is created (based upon that parent page name) and is imbedded inside the parent page (using the Include Page Macro {include:...}).

WHY?

In doing this, I can have a repository of structured data which can be efficiently presented, searched etc, AND a running notes/test area on the page which can be manipulated by users on the fly. This way, I get a really rich and rapidly grown repository for my userbase.

1 answer

This widget could not be displayed.

Cracked it (well, in fact Mick Roff did!!! This solution includes his text. Thanks Mick!)

Firstly, put the create childs in a report to minimise when the report is run. This is set it up only to run within the first 60 seconds of the parent page being created. This ensures child pages that have been spawned can be deleted if required. If you don’t have this restriction, then the child pages will continue to be spawned if they are not present.

Then, the use of the replace and render function allows you to replace %title% with the name of the parent page.

Finally, add a {create-child} macro (in a {replace} macro) to add a child page of the correct title.

Should look like:

{report-block}
{local-reporter:content:creation date}
{date-filter:creation date|afterValue=-60s|format=hh:mm:ss dd MMM, yyyy}
{local-reporter}
{report-body}
{replace-and-render} {replace-body}
{create-child:%title% - Notes|parent=@self|template=Notes Page}
   {create-child:Grandchild Page -%title%|parent=Child Page -%title%|template=Blank }
{replace-body} {replace-item:%title%} {report-info:report:root content > page:title}{replace-item} {replace-and-render}
{report-body}
{report-block}

And:

{replace-and-render} {replace-body}
{create-child:Child Page -%title%|parent=@self|template=Blank }
   {create-child:Grandchild %title% - Notes|parent=Child Page -%title%| }
{replace-body} {replace-item:%title%} {report-info:report:root content > page:title}{replace-item} {replace-and-render}

The next thing I have to work out is how to automatically pre-fill the notes page (either with a template or without) in order that It renders content as soon as the main page template is saved. At the moment, it shows the pink 'macro error' lines of text where the child pages should render, which is not fixed until they are opened, edited and saved (which completes the parent page).

Any answers to that last piece of the jigsaw?

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Jul 30, 2018 in Confluence

How Manon Soubies-Camy uses Confluence + Trello to organize webinar notes and her knitting stash

@Manon Soubies-Camy is an engineer who has been an avid Atlassian user since 2014. She helps companies of all sizes transform the way they work with the Atlassian stack, including Jira and Confl...

863 views 8 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you