Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Document Properties Marker
doctypetopic
overridefalse


Short DescriptionFrom your idea to realization on your Confluence server in nearly no time. Make adjustments to the user interface a no-event!
NameDeploy Userscripts in a Flash!
Short Name
Parent
Parent Property
property-nameName
hide
Audience
Name List
doctyperole
render-no-hits-as-blanktrue
property-restrict-value-rangetrue
propertyAudience
empty-as-nonetrue

Subject
Name List
doctypesubject
propertySubject

Categories
Name List
doctypecategory
property-restrict-value-rangetrue
propertyCategories

Tags
Tag List
propertyTags

Flagshide
Iteration

Iteration
valuereleased

hide
Type
Name List
doctypetopic-type
render-no-hits-as-blanktrue
property-restrict-value-rangetrue
propertyType

Level of Experience
Name List
doctypeexperience-level
render-no-hits-as-blanktrue
propertyLevel of Experience

Expected Duration
Sponsors
Name List
doctypestakeholder,organization,person,role
render-no-hits-as-blanktrue
propertySponsors

Sort Keyhide



Section
show-titlefalse
titleDescription
In four steps from your idea to your solution in use.


Section
titleSummary


Section
titlePrerequisites


Steps


Section
titleThe Idea

We want to remove the create button that creates a new blank page.

Section


Column


Panel
titleCurrent Situation

The split button in the Confluence menu:

  • Click left on 'Create' to create an empty page (based on no template)
  • Click right on "..." to open the page wizard selection dialog

The shortcut 'c' clicks the left button, creating a new blank document.



Column


Panel
titleDesired Situation

We would like to make it easier for users to create a new page based on a template.

Therefore we remove the left button and replace the label of the right.

When the user hits the shortcut 'c'. the page wizard selection dialog opens.






Section
titleThe Script

The script implements the solution:

Code Block
languagejs
titlecreate-with-template.js
"use strict";
 
AJS.toInit(function () {
  const $quickCreateButton = AJS.$('#quick-create-page-button');
  if ($quickCreateButton.length) {
    $quickCreateButton.hide();
    const $createButton = AJS.$('#create-page-button');
    if ($createButton.length) {
      $createButton.text("Create ...");
 
      $(document).on('keydown', null, 'c', function () {
        $createButton.click();
      });
    }
  }
});



Section
titleThe Deployment

The way to production:

  1. Attach the JavaScript file to a page, copy the URL to the attached file
  2. Open the 
    Dynamic Document Link
    maximumSelectionSize1
    supportTaggingtrue
    focustrue
    pageUserscript Admin Tool
    multiSelecttrue

  3. Click submit and all users in the authors group enjoy the new create button!


Section
titleIt's in Use!

Packed up and ready to go ..



Section
ignore-template-buttonstrue
titleSubordinate Topics


Hide From Reader

Create from template
blueprintModuleCompleteKeyde.smartics.atlassian.confluence.smartics-projectdoc-confluence-space-core:projectdoc-blueprint-doctype-topic
buttonLabelCreate Topic

Display Table
doctypetopic
render-no-hits-as-blanktrue
render-modedefinition
selectName, Short Description
restrict-to-immediate-childrentrue
sort-bySort Key, Name
render-classeschildren-table, display-table, children


Section
required-permissionswrite-access
titleNotes


Section
titleReferences
intro-textEvidence for the information is available by the following references.


Tour
render-no-hits-as-blanktrue
render-as-definition-listtrue
marker-column-property-nameTitle
replace-title-with-nametrue


TitleShort Description





Section
titleResources
intro-textMore information on this topic is available by the following resources.


Tour
render-no-hits-as-blanktrue
render-as-definition-listtrue
marker-column-property-nameTitle
replace-title-with-nametrue


TitleShort Description
Create with Template