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?
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 : https://developer.atlassian.com/display/CONFDEV/Javascript+API+for+blueprint+wizards 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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where do you want the date to be inserted? In the page title or the page body? Can you give an example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.