A tool for easily accessing your HashBrown CMS content data on your site
$ npm install hashbrown-driver
const HashBrown = require('hashbrown-driver');
Check out the example project
The helper classes are accessed thusly:
HashBrown.content // ContentHelper
HashBrown.media // MediaHelper
HashBrown.forms // FormsHelper
HashBrown.templates // TemplateHelper
A helper class for fetching content
Kind: global class
- ContentHelper
- .getTree(updateCache) ⇒
Promise
- .setTree(json) ⇒
Promise
- .getById(id) ⇒
Promise
- .getByUrl(url) ⇒
Promise
- .deleteById(id) ⇒
Promise
- .setById(id, content) ⇒
Promise
- .setPropertiesById(id, properties, language, meta) ⇒
Promise
- .getPropertiesById(id, language) ⇒
Promise
- .getTree(updateCache) ⇒
Gets the entire content tree
Kind: static method of ContentHelper
Returns: Promise
- Object
Param | Type | Default |
---|---|---|
updateCache | Boolean |
false |
Saves the JSON tree
Kind: static method of ContentHelper
Returns: Promise
- promise
Param | Type |
---|---|
json | Object |
Gets a content node by id
Kind: static method of ContentHelper
Returns: Promise
- Content
Param | Type |
---|---|
id | String |
Gets a content node by url
Kind: static method of ContentHelper
Returns: Promise
- Content
Param | Type |
---|---|
url | String |
Delete a content node by id
Kind: static method of ContentHelper
Returns: Promise
- Result
Param | Type |
---|---|
id | String |
Sets a content node by id
Kind: static method of ContentHelper
Returns: Promise
- Content
Param | Type |
---|---|
id | String |
content | Object |
Sets content node properties by id
Kind: static method of ContentHelper
Returns: Promise
- Content
Param | Type |
---|---|
id | String |
properties | Object |
language | String |
meta | Object |
Gets content node properties by id
Kind: static method of ContentHelper
Returns: Promise
- Content
Param | Type |
---|---|
id | String |
language | String |
A helpers class for processing forms
Submits an entry
Kind: static method of FormsHelper
Returns: Promise
- Result
Param | Type |
---|---|
id | String |
query | Object |
A helper class for fetching templates
Kind: global class
- TemplateHelper
- .get(type, name) ⇒
Promise
- .getAll(type) ⇒
Promise
- .get(type, name) ⇒
Gets a Template by name
Kind: static method of TemplateHelper
Returns: Promise
- Template
Param | Type |
---|---|
type | String |
name | String |
Gets all template objects
Kind: static method of TemplateHelper
Returns: Promise
- Template
Param | Type |
---|---|
type | String |