TypesΒΆ

Note

These docs are generated by code tests, therefore you will see some ‘test’ contenttypes appear here.

Available content types in a Plone site can be listed and queried by accessing the /@types endpoint on any context (requires an authenticated user). The ‘addable’ key specifies if the content type can be added to the current context. The ‘layouts’ key specifies the defined views.

http

GET /plone/@types HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i http://nohost/plone/@types -H "Accept: application/json" --user admin:secret

httpie

http -j http://nohost/plone/@types -a admin:secret

python-requests

requests.get('http://nohost/plone/@types', headers={'Accept': 'application/json'}, auth=('admin', 'secret'))
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "@id": "http://localhost:55001/plone/@types/Collection", 
    "addable": true, 
    "title": "Collection"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/Discussion Item", 
    "addable": false, 
    "title": "Discussion Item"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/DXTestDocument", 
    "addable": true, 
    "title": "DXTestDocument"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/Event", 
    "addable": true, 
    "title": "Event"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/File", 
    "addable": true, 
    "title": "File"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/Folder", 
    "addable": true, 
    "title": "Folder"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/Image", 
    "addable": true, 
    "title": "Image"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/Link", 
    "addable": true, 
    "title": "Link"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/News Item", 
    "addable": true, 
    "title": "News Item"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/Document", 
    "addable": true, 
    "title": "Document"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/ATTestDocument", 
    "addable": true, 
    "title": "ATTestDocument"
  }, 
  {
    "@id": "http://localhost:55001/plone/@types/ATTestFolder", 
    "addable": true, 
    "title": "ATTestFolder"
  }
]

To get the schema of a content type, access the /@types endpoint with the name of the content type, e.g. '/plone/@types/Document‘:

http

GET /plone/@types/Document HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i http://nohost/plone/@types/Document -H "Accept: application/json" --user admin:secret

httpie

http -j http://nohost/plone/@types/Document -a admin:secret

python-requests

requests.get('http://nohost/plone/@types/Document', headers={'Accept': 'application/json'}, auth=('admin', 'secret'))
HTTP/1.1 200 OK
Content-Type: application/json+schema

{
  "fieldsets": [
    {
      "fields": [
        "title", 
        "description", 
        "text", 
        "changeNote"
      ], 
      "id": "default", 
      "title": "Default"
    }, 
    {
      "fields": [
        "allow_discussion", 
        "exclude_from_nav", 
        "table_of_contents"
      ], 
      "id": "settings", 
      "title": "Settings"
    }, 
    {
      "fields": [
        "subjects", 
        "language", 
        "relatedItems"
      ], 
      "id": "categorization", 
      "title": "Categorization"
    }, 
    {
      "fields": [
        "effective", 
        "expires"
      ], 
      "id": "dates", 
      "title": "Dates"
    }, 
    {
      "fields": [
        "creators", 
        "contributors", 
        "rights"
      ], 
      "id": "ownership", 
      "title": "Ownership"
    }
  ], 
  "layouts": [
    "document_view"
  ], 
  "properties": {
    "allow_discussion": {
      "choices": [
        [
          "True", 
          "Yes"
        ], 
        [
          "False", 
          "No"
        ]
      ], 
      "description": "Allow discussion for this content object.", 
      "enum": [
        "True", 
        "False"
      ], 
      "enumNames": [
        "Yes", 
        "No"
      ], 
      "title": "Allow discussion", 
      "type": "string"
    }, 
    "changeNote": {
      "description": "Enter a comment that describes the changes you made.", 
      "title": "Change Note", 
      "type": "string"
    }, 
    "contributors": {
      "additionalItems": true, 
      "description": "The names of people that have contributed to this item. Each contributor should be on a separate line.", 
      "items": {
        "description": "", 
        "title": "", 
        "type": "string"
      }, 
      "title": "Contributors", 
      "type": "array", 
      "uniqueItems": true
    }, 
    "creators": {
      "additionalItems": true, 
      "description": "Persons responsible for creating the content of this item. Please enter a list of user names, one per line. The principal creator should come first.", 
      "items": {
        "description": "", 
        "title": "", 
        "type": "string"
      }, 
      "title": "Creators", 
      "type": "array", 
      "uniqueItems": true
    }, 
    "description": {
      "description": "Used in item listings and search results.", 
      "minLength": 0, 
      "title": "Summary", 
      "type": "string", 
      "widget": "textarea"
    }, 
    "effective": {
      "description": "If this date is in the future, the content will not show up in listings and searches until this date.", 
      "title": "Publishing Date", 
      "type": "string", 
      "widget": "datetime"
    }, 
    "exclude_from_nav": {
      "default": false, 
      "description": "If selected, this item will not appear in the navigation tree", 
      "title": "Exclude from navigation", 
      "type": "boolean"
    }, 
    "expires": {
      "description": "When this date is reached, the content will nolonger be visible in listings and searches.", 
      "title": "Expiration Date", 
      "type": "string", 
      "widget": "datetime"
    }, 
    "language": {
      "choices": [
        [
          "de", 
          "Deutsch"
        ], 
        [
          "en", 
          "English"
        ], 
        [
          "es", 
          "Espa\u00f1ol"
        ], 
        [
          "fr", 
          "Fran\u00e7ais"
        ]
      ], 
      "default": "en", 
      "description": "", 
      "enum": [
        "de", 
        "en", 
        "es", 
        "fr"
      ], 
      "enumNames": [
        "Deutsch", 
        "English", 
        "Espa\u00f1ol", 
        "Fran\u00e7ais"
      ], 
      "title": "Language", 
      "type": "string"
    }, 
    "relatedItems": {
      "additionalItems": true, 
      "default": [], 
      "description": "", 
      "items": {
        "description": "", 
        "title": "Related", 
        "type": "string"
      }, 
      "title": "Related Items", 
      "type": "array", 
      "uniqueItems": true
    }, 
    "rights": {
      "description": "Copyright statement or other rights information on this item.", 
      "minLength": 0, 
      "title": "Rights", 
      "type": "string", 
      "widget": "textarea"
    }, 
    "subjects": {
      "additionalItems": true, 
      "description": "Tags are commonly used for ad-hoc organization of content.", 
      "items": {
        "description": "", 
        "title": "", 
        "type": "string"
      }, 
      "title": "Tags", 
      "type": "array", 
      "uniqueItems": true
    }, 
    "table_of_contents": {
      "description": "If selected, this will show a table of contents at the top of the page.", 
      "title": "Table of contents", 
      "type": "boolean"
    }, 
    "text": {
      "description": "", 
      "title": "Text", 
      "type": "string", 
      "widget": "richtext"
    }, 
    "title": {
      "description": "", 
      "title": "Title", 
      "type": "string"
    }
  }, 
  "required": [
    "title", 
    "exclude_from_nav"
  ], 
  "title": "Page", 
  "type": "object"
}

The content type schema uses the JSON Schema format.

See Types Schema for a detailed documentation about the available field types.