Create page from blueprint with todays date

Using Confluence OnDemand as an administrator, I want to create a blueprint that inserts the date when a page is created.

This functionality already exists on some out-the-box blueprints.

Is this possible?

3 answers

You will have to write code for this blueprint - firstly create a soy template , use the following configuration to setup the title of the page:

<input id="topic-title" class="text  long-field" type="text" name="title" title="title"
                   placeholder="{getText('some.placeholder')}" maxlength="255">


Now with that done, you will have to append the current date with the necessary format  to the input id above, in the postRender method of the blueprint (Refer : for more details.


Ok, so that will take care of setting the title of the page.


Now to add the date in the page body, you will have to write a user macro (either in Java or Velocity) that returns the date, then use it in the template used by the blueprint you created above, that way, it will render the date wherever the macro is put in the template. Please refer to the confluence guides for creating macros for more on this.


So to sum up, you would need a new blueprint and a macro to achieve this.

Thanks for your response! Will this be possible using Confluence OnDemand?

It probably should be , as all we are doing is creating a macro and a blueprint using the standard documented procedures. I am not very familiar with Confluence OnDemand but cant think of a reason why this shouldnt work as its all standard javascript and java/velocity.

Where do you want the date to be inserted? In the page title or the page body? Can you give an example?

Ideally, both. For example, I create a page using a blueprint and the title of the page by default is 'Page title - 9 Sept 2014'. The same content (date) would be also be available in the body.


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.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

482 views 3 18
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