Content manager
: shell
: content
: content-manager
: /modules/core/content/services/content-manager.js
: https://github.com/DecentCMS/DecentCMS/blob/master/modules/core/content/services/content-manager.js
ContentManager()
The ContentManager is responsible for facilitating the usage of content items, content parts, and content types.
Kind: global function
- ContentManager()
- .getTypeName(item) ⇒
string - .getType(item) ⇒
object - .getPartNames(item, [partTypeName]) ⇒
Array - .getParts(item, [partTypeName]) ⇒
Array - .getPartType(item, partName) ⇒
string
- .getTypeName(item) ⇒
contentManager.getTypeName(item) ⇒ string
Finds the type name of an item if it exists on the tenant configuration.
Kind: instance method of ContentManager
Returns: string - The content type name, or null if it can't be found.
| Param | Type | Description |
|---|---|---|
| item | object |
The content item. |
contentManager.getType(item) ⇒ object
Finds the type definition of an item if it exists on the tenant configuration.
Kind: instance method of ContentManager
Returns: object - The content type definition, or null if it can't be found.
| Param | Type | Description |
|---|---|---|
| item | object |
The content item. |
contentManager.getPartNames(item, [partTypeName]) ⇒ Array
Gets a list of part names that are of the part type the gets passed in.
Kind: instance method of ContentManager
Returns: Array - An array of part names.
| Param | Type | Description |
|---|---|---|
| item | object |
The content item. |
| [partTypeName] | string |
The name of the part type to look for. All parts are returned if this is not specified. |
contentManager.getParts(item, [partTypeName]) ⇒ Array
Gets a list of parts that are of the part type the gets passed in.
Kind: instance method of ContentManager
Returns: Array - An array of parts.
| Param | Type | Description |
|---|---|---|
| item | object |
The content item. |
| [partTypeName] | string |
The name of the part type to look for. All parts are returned if this is not specified. |
contentManager.getPartType(item, partName) ⇒ string
Finds the type of a part.
Kind: instance method of ContentManager
Returns: string - The name of the type of the part.
| Param | Type | Description |
|---|---|---|
| item | object |
The content item. |
| partName | string |
The part's name. |