w2sidebar.insert

Inserts a node or nodes before node before.
insert([parent], before, nodes)
parent string, id of the node (optional)
before string or object, id of the node or node object
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 of the parent node. 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 to the parent of the before node.
New nodes will be inserted before node before, which is an id of the node or node object. If you want to append nodes, the before argument should be null. You can also use .add() method.
This method returns last inserted node object.
If you defined the object in the following way: You can:

User Comments

comments powered by Disqus