Page tree

Versions Compared

Key

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

Content Layer
namePage Info
id278129461
classwatermark-layer
Content Column
namePage Body
width100.00001%
id278129463
Content Block
background-colortransparent
namePrompt
id494677873
classtight manual-prompt-flex

A user's selection from a picklist of options will be applied as a label to the page created from a Blueprint.

Content Block
nameOutcome
rich-link-hoverstrue
id1042866408
classtight manual-outcome-flex

Now you can add labels to a page during Blueprint creation. In the Blueprint Wizard, users can select from a picklist of options. Their choice will be applied to the page as a label. This requires a small amount of additional configuration in the JSON Definition file, but it's worth the effort!

Content Block
nameSteps
rich-link-hoverstrue
id494842117
classsteps-block numbered manual-steps-flex tight-bottom

Create your Page Blueprint

Learn about creating a Page Blueprint. If you'd like to show the label names, as text, on the page itself, then use a substitution field in the place where you want your user's picklist selection to be presented. The label text will be displayed wherever this substitution field is placed, in addition to applying a Confluence label to the page. 

Access your Blueprint JSON Definition

Read more about Accessing and Editing the JSON File.

Set the "type" to "list", and add the "values" attribute to the blueprintField object

Add a new line to your Blueprint Field object definition, as seen in the code snippet below. The values for the "values" attribute will be the options displayed to the user. This is an array of items in quotations. The items must conform to Confluence label requirements, namely: all lowercase and with no special characters except hyphens and underscores. Invalid labels will result in an error message.

Code Block
languagejs
"blueprintFields" : [
		{
			"id"			: "content-type",
			"name"			: "Content Type",
			"type"			: "list",
			"required"		: true,
			"helpText"		: "Select a content type from the list. It will apply a label to the page.",
			"values"		: [ "article", "memo", "policy", "profile_page", "tpps_report"],
			"addLabels"		: true
		},
		...
]

Add the "addLabels" attributes and set it to true

To apply the selected item as a label on the page, set the "addLabels" attribute to true

Optionally: add "multiselect" and set it to true

To allow users to select more than one value, set the "multiselect" attribute in the JSON to true. Doing so with the addLabels attribute set to true will result in all of the selections being added as labels to the page. Note that if the substitution field is on the page (and these are intended to display), multiple selections will be presented in a comma-separated sequence.

Re-Upload your JSON to the Blueprint Definition Page

That's It!

Test your Blueprint by creating a page from it. The options shown should be those defined in the "values" array (in our example: "article", "memo", etc.). The selected option should display on your page wherever its substitution field was placed. Additionally, the selected option will be applied as a label to the page.

Content Block
nameNote
rich-link-hoverstrue
id495965127
classmanual-note-flex
collapsiblecollapse
Note

If using:

  1. Replace me with something to note about this how-to entry that falls outside the scope of all other sections; and
  2. Add the tight-bottom class to the Steps block above to narrow the gap between the two blocks.
Content Block
nameTip
rich-link-hoverstrue
id894522670
classmanual-tip-flex
Tip

Got Targeted Search? Want to use Search Filters instead of these manually defined values? Check out Using Targeted Search Filters in a Blueprint Maker Blueprint!

Content Block
nameWarning
rich-link-hoverstrue
id894530759
classmanual-warning-flex
collapsiblecollapse
Warning

If using:

  1. Replace me with something to note about this how-to entry that falls outside the scope of all other sections; and
  2. Add the tight-bottom class to the next visible/non-collapsed block above this one to narrow the gap between the two blocks.
Content Block
nameInfo
rich-link-hoverstrue
id894537203
classmanual-info-flex
collapsiblecollapse
Info

If using:

  1. Replace me with something to note about this how-to entry that falls outside the scope of all other sections; and
  2. Add the tight-bottom class to the next visible/non-collapsed block above this one to narrow the gap between the two blocks.
Content Layer
background-color$lightGrayColor
nameRelated
id888168050
Content Column
nameRelated
width100%
id888168051
Content Block
rich-links-hide-descriptiontrue
rich-link-hoverstrue
rich-links-columns4
rich-links-verticaltrue
rich-links-image-height100px
rich-links-hide-site-icontrue
rich-links-details-padding10px
nameRelated
rich-links-enabletrue
border-width0
rich-links-details-alignmentleft
rich-links-margin20px 30px 0 0
id496234544
classrelated-block clean manual-related-flex