Add variable $title to page title when creating from template and to Third party add-ons

XMLWordPrintable

    • 1

      If you create a new page from a template, you can use @currentDate to make the new page with the date of today in the title. You can't do that 2x on the same day as the page title is no longer unique the second time.

      At my former employer we used Confluence Server and we created a macro that generated the page title from @currentDate ànd the variable $title that we used in Page Properties.

      Could we add a similar macro to Confluence Cloud?

      The macro was like this:

      ## @noparams
      <script>
      $( "input[name='variableValues.title']" ).change(function(){
      console.log($(this).val());
      $("form[name='filltemplateform']").find("input[name='title']").val( "$action.dateFormatter.formatGivenString("yyyy-MM-dd", $content.getCreationDate()) - " + $(this).val())
      $action.dateFormatter.formatGivenString("yyyy-MM-dd", $content.currentDate)
      })
      </script> 

      And it was implemented like this:

      And it looked like this:

            Assignee:
            Unassigned
            Reporter:
            Erik Boelen
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: