Create your Page BlueprintLearn 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 DefinitionRead more about Accessing and Editing the JSON File. Set the "type" to "list", and add the "values" attribute to the blueprintField objectAdd 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 |
---|
| "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 trueTo apply the selected item as a label on the page, set the "addLabels" attribute to true . Optionally: add "multiselect" and set it to trueTo 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. 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. |