Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Have a look here: https://answers.atlassian.com/questions/332522
You'd have to create a blueprint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I agree, this is better than the accepted solution mentioned which gets into programming and macros.
A template, a page with a Create from Template Macro, and your all set. If you include tags on your template, you can build a children display, essentially like the Meeting Notes page you get on a new space.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Davin (or anyone who might be able to help).
I have created this macro on a page using the @currentDate feature and it works, but it places the newly created page at the bottom of the list of past pages (also with their current/created dates as titles). It seems the only way to sort is alphabetically and when I toggle the option it puts all the pages in oldest date first to newest last.
How do I get it to default to the top of the list?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IMHO there is no way to achieve this in an automated way. Correct me if I'm wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, no automated way, but I did find this thread from 2016 and am trying it. So far, I put in the code into the Look and Feel--> Stylesheet, but it didn't work, so perhaps I captured the wrong child id number. Trying again...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
oops forgot to paste the link:
https://community.atlassian.com/t5/Confluence-questions/Sorting-order-of-child-pages-in-Confluence/qaq-p/404393
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, that sounds interesting but could possibly break something else in the page tree.
Nevertheless, worth a try.
I think it is not about capturing the right child ID number but the right HTML element resp. CSS class to apply this styling to. This depends on your Confluence version and if you have any plugins installed that are affecting the page tree.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, it seems to work! I had left out the last number of the child ID. Now it works! I keep creating new child pages with future dates as the page title/name, and they automatically are put at the top of the list exactly how I wanted. And nothing else so far seems to be messed up from it. While this should be an easy button feature, I'm happy with myself for researching and applying this. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This doesn't seem to be compatible with the new editor in my testing. Anyone else seeing different results?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, labels and the page nam are no longer defaulting. I wish we could use the old editor until they fix all the annoying issues with the new one
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is close to what I was looking for. I want to populate the title with a specific title, that the user can add to at the time of creation. Right now, when a user creates my template, the title goes blank. I want to be able to generate something like: "Client Page: X", where the user can fill in X with the name of the client.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shanta,
I once also had a similar requirement and implemented a user macro that can be inserted as a button to a page.
Clicking on this button will create a new page below the page that contains the button and will set a specific page title and specific labels that are given with the macro.
If you are interested, I can post the macro code.
Cheers,
Kirstin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've been able to accomplish that in other areas, especially with the date, but in this case, it's based on a template in new spaces that we create for a new client. I'm actually working on a way to create an entire space template, so the only "button" I really want is "Create this space" and have it create the relevant pages, templates and titles. For the case I posted here, I have no where to put the button.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, OK. This is something different from what I did. IMHO you will end up with coding (blueprint/plugin).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was headed in that direction anyway. Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kristin.
I'm a Confluence newbie and are looking to achieve exactly what you solved.
Would be very grateful if You could help me with this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Petter,
my macro handles dates and labels. It generates a blogpost title like <label> - Statusreport Woche 14/2020.
## Macro title: SA Blog Post Button
## Macro has a body: No
## Body processing: No macro body
##
## Developed by: Kirstin Seidel-Gebert
## Date created: 22.03.2013
## Installed by: Kirstin Seidel-Gebert
## 19.02.2014 KGE Initialize the blog post title with a combination of
## - customer name (taken from the confluence page title, the macro is embedded in)
## - week and year of the current date
## 11.03.2014 KGE Remove "system" labels from list of labels
## Atlassian uses the labels for managing the favorites of users. Labels starting with "~" or "my:" are system labels.
## Only add &labelsstring to the URL, if it isn't empty.
## @param Pl:title=Label with page labels|type=boolean|desc=If checked, the blog post automatically gets labeled with all labels of the page the macro was added to.|required=true
## @param Labels:title=Labels|type=string|desc=Enter the additional labels for this new blog post as a comma separated list.|required=false
## @param LinkText:title=Link/Button Text|Level|type=string|desc=Enter the text of the link/button.|required=true
## Get the base URL of Confluence.
#set( $wikibaseurl = "${req.getContextPath()}" )
## Check whether the blog post should be automatically labeled.
#set( $pageLabels = [] )
#set( $pageLabels = $content.getLabels() )
## Add the additional labels.
## --------------------------
#set ( $addLabelsString = "" )
#if ( $paramLabels )
#set ( $addLabelsString = $paramLabels )
#end
#if ( $pageLabels && $paramPl )
#foreach ($label in $pageLabels)
#set ( $lstr = $label.toString() )
#if ( $lstr.substring(0,1) != "~" && $lstr.substring(0,3) != "my:" )
## Add comma before adding an additional label (not if empty)
#if ( $addLabelsString != "" )
#set ( $addLabelsString = $addLabelsString + ", " )
#end
## Append Label
#set ( $addLabelsString = $addLabelsString + $label )
#end
#end
#end
## Construct the blog post title.
## ------------------------------
## First get year and week.
#set ( $currentDate = $content.currentDate )
#set ( $year = ${action.dateFormatter.formatGivenString("yyyy", $currentDate)} )
#set ( $week = ${action.dateFormatter.formatGivenString("ww", $currentDate)} )
## Next get the customer name from the page title.
## Initialize $blogTitle
#set ( $blogTitle="<Kundenname> - " )
## Get the page title and split it into words.
#set ( $pageTitle = $content.getTitle() )
#set ( $titleArray = $pageTitle.split(" ") )
## Convert the array of words into a list that can be handled by velocity.
#set ( $titleList = [] )
#foreach ($element in $titleArray)
#set ( $dummy = $titleList.add($element) )
#end
#set ( $blogTitle = $titleList.get(0) + " - Statusreport Woche " + $week + "/" + $year )
## debug <p>$pageTitle</p>
## Insert the button/link.
## -----------------------
<span class="e2e-button">
#if ( $addLabelsString != "" )
<a href='$wikibaseurl/pages/createblogpost.action?spaceKey=$space.key&title=$blogTitle&labelsString=${addLabelsString}'>$paramLinkText</a>
#else
<a href='$wikibaseurl/pages/createblogpost.action?spaceKey=$space.key&title=$blogTitle'>$paramLinkText</a>
#end
</span>
The part relating to the date is the following:
## First get year and week.
#set ( $currentDate = $content.currentDate )
#set ( $year = ${action.dateFormatter.formatGivenString("yyyy", $currentDate)} )
#set ( $week = ${action.dateFormatter.formatGivenString("ww", $currentDate)} )
[...]
#set ( $blogTitle = $titleList.get(0) + " - Statusreport Woche " + $week + "/" + $year )
Hope that helps.
Cheers,
Kirstin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kirstin Seidel-Gebert Love the user macro! Great idea.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Davin. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Our Add-on provides default tags like __Current_date__, etc. They can be used within the page title and anywhere on the page; also in macro parameters.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.