w2sidebar.add

Adds a sidebar node or nodes.
add([parent], nodes)
parent string, id of the parent node (optional)
nodes object or array, sidebar nodes to add
Returns object.

Description

The nodes argument can be either an object or array of objects. If it is an object it represents a sidebar node that will be added to .nodes array. If it is an array then each element of the array will be treated as a separate sidebar node object.
The first optional argument parent is an id of the parent node or parent node itself. If parent node is not specified, new nodes will be inserted at the root level.
The method will return last inserted node.
If you defined the object in the following way: You can:

User Comments

comments powered by Disqus