Seneca CMS module
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
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.
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.
Removes an element using its id
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.
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'.
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.
Returns a list of all categories.
Removes a category.
Saves a new ategory assigning it a unique id. Or performs an update to an existing category when an id is specified.
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.