ScalarNode
The ScalarNode class represents a single node of a Scalar book.
Methods
Method | Type | Description |
---|---|---|
getDisplayTitle( removeMarkup:boolean ) | string | Returns the title of the node, formatted for display. If the removeMarkup parameter is true, HTML markup will be removed from the title. |
getDominantScalarType() | object | Returns an object literal describing the most specialized type associated with the node— for example: while every path is also a page, this method will only return the “path” object for nodes that are paths. |
getRelatedNodes( type:string, direction:string, includeNonPages:boolean ) | array | Returns an array of ScalarNode objects related to the node by the specified criteria. Method parameters:
|
getRelations( type:string, direction:string, sort:string, includeNonPages:boolean ) | array | Returns an array of ScalarRelation objects related to the node by the specified criteria. Method parameters:
|
getSortTitle() | string | Returns the title of the node, formatted for alphabetical sorting (i.e. with initial non-alphabetic components like the word “the” removed). Normally used for internal processing of arrays of nodes. |
hasScalarType( typeName:string ) | boolean | Returns true if any of the Scalar types associated with the node match the specified type name. |
Properties
Property | Type | Description |
---|---|---|
color | string | The HTML color associated with this node. |
current | ScalarVersion | The most current known ScalarVersion associated with the node. |
data | object | The raw JSON data for the node. |
defaultView | string | The name of the default view associated with this node. |
incomingRelations | array | An array of ScalarRelation objects describing the node’s incoming relationships. |
outgoingRelations | array | An array of ScalarRelation objects describing the node’s outgoing relationships. |
properties | object | All known properties associated with the node. |
scalarTypes | array | An array of objects describing all of the Scalar types this node is a member of. |
slug | string | The unique URI segment that identifies the node within the current book. |
thumbnail | string | The URL of the thumbnail image associated with this node. |
url | string | The URL of the node. |
versions | array | An array of all known ScalarVersions associated with the node. |
Previous page on path | Scalar API JavaScript library reference, page 3 of 5 | Next page on path |
Discussion of "ScalarNode"
Add your voice to this discussion.
Checking your signed in status ...