Seneca CMS module
This is a cms plugin for the Seneca framework
If you're using this module, feel free to contact me on Twitter if you have any questions @gangleri_
Current Version: 0.1.0
npm install seneca-cms
###role: plugin, cmd: load, kind: element Load an element using it's unique id or name.
Returns JSON you should check the ok property to determine if the action was successful. When successful the retreived element is accessible via the 'element' property.
If the action is not successful the 'message' property will hold a string explaining the reason.
###role: plugin, cmd: list, kind: element List all elements or if the optional 'category' is provided it will only list elements in that category.
Returns JSON, the 'ok' property should be check to ensure the operation has completed successfully. On successful execution the 'list' property holds a list of elements.
On an error the 'message' property will indicate what went wrong.
###role: plugin, cmd: remove, kind: element Removes an element using its id
###role: plugin, cmd: save, kind: element Saves a new element and will assign a unique id. If an id is specified it will perform an update on the element.
Returns JSON the 'ok' property indicates if this operation has succeeded. On success the element is returned in the 'elem' property with an 'id' set. On failure the 'message' property will indicate the reason.
###role: plugin, cmd: get, kind: element Gets the HTML content of an element based on its name. It will always return JSON with single property 'html' when the operation succeeds the property holds the html content, when it fails it holds a simple string stating 'no element found'.
###role: plugin, cmd: load, kind: category Loads a category based on name or id. The returned JSON has an 'ok' property that can be used to determine the success of this operation. On success the 'category' property holds the categort. On error the 'message' property will hold a message indicating what the problem is.
###role: plugin, cmd: list, kind: category Returns a list of all categories.
###role: plugin, cmd: remove, kind: category Removes a category.
###role: plugin, cmd: save, kind: category Saves a new ategory assigning it a unique id. Or performs an update to an existing category when an id is specified.
###role: plugin, cmd: exists, kind: category Checks if a category name already exists. The returned JSON uses the 'ok' property to indicate success and the 'found' boolean property to indicate is the category exists or not.