Skip to content

Instantly share code, notes, and snippets.

@warrenbuckley
Last active November 8, 2016 19:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save warrenbuckley/10599383 to your computer and use it in GitHub Desktop.
Save warrenbuckley/10599383 to your computer and use it in GitHub Desktop.
JSON Schema for Umbraco Property Editor Package Manifest
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "propertyEditors",
"description": "An array of Umbraco Property Editors",
"type": "object",
"properties": {
"name": {
"description": "The friendly name of the property editor, shown in the Umbraco backoffice",
"type": "string"
},
"alias": {
"description": "This must be a unique alias to your property editor",
"type": "string"
},
"editor": {
"description": "This describes details about the editor",
"type": "object",
"properties": {
"view": {
"type": "string",
"description": "This is the full path to the HTML view for your property editor"
},
"valueType": {
"type": "string",
"description": "This is the type of data you want your property editor to save to Umbraco",
"enum": [ "STRING", "JSON", "DATETIME", "TEXT", "INT" ]
},
"hideLabel": {
type: "boolean",
description: "If set to true this hides the label for the property editor when used in Umbraco on a document type"
},
"isReadOnly": {
type: "boolean",
description: "If set to true this makes the property editor read only"
},
"required": ["view", "valueType"]
}
},
"prevalues": {
type: "object",
description: "This is an object that stores an array of prevalue fields or options to configure yout property editor",
properties: {
"fields": {
type: "object",
description: "This is the collection of prevalue fields",
"properties": {
"key": {
type: "string",
description: "A unique key for the prevalue field"
},
"label": {
type: "string",
description: "The user friendly label for the prevalue"
},
"description": {
type: "string",
description: "A more detailed description for the user"
},
"view": {
type: "string",
description: "The type of editor to use for this prevalue field"
},
"required": [ "key", "label", "description", "view" ]
}
}
}
},
required: [ "name", "alias" ]
},
"javascript": {
"type": "array",
description: "A list of Javascript files with full path to load for your property editor",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"css": {
"type": "array",
description: "A list of CSS files with full path to load for your property editor",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"required": ["name"]
}
@nojaf
Copy link

nojaf commented May 16, 2014

I've tested this with VS 2013 Update 2, doesn't seem to work correctly.
Can anyone confirm this? If so, how can I help?

@enkelmedia
Copy link

Anyone know how to add this to the JSON editor in VS?

@Lechus
Copy link

Lechus commented Jun 15, 2015

@warrenbuckley: Could you give some tip how to install it?

@warrenbuckley
Copy link
Author

@Lechus @enkelmedia & @nojaf
In Visual Studio 2015 you can map the .manifest file extension in Options of Visual Studio like so

  • Tools --> Options
  • Text Editor
  • File Extensions
  • Add new extension .manifest & Experience JSON Editor

Reopen the package.manifest file you should see a Schema in the dropdown top left to http://json.schemastore.org/package.manifest where the official version of this is hosted.

@nul800sebastiaan
Copy link

@warrenbuckley You can add: isParameterEditor (under alias in propertyEditors). It's a boolean, so values can be true or false.

@nul800sebastiaan
Copy link

@warrenbuckley And description: "Indicates whether this property editor can be used to edit parameters on macros"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment