API Docs for: 0.8.0
Show:

SiteMapService Class

Constructor

SiteMapService

(
  • context
)

Parameters:

Methods

_serializeItems

(
  • items
  • cb
)
private

Parameters:

  • items Array
  • cb Function

formatGetResults

(
  • cb
)
Function static

Returns a function that accepts two parameters. The first is an error, if exists, and the second is an array of arrays. The returning function, when executed, reduces the array of arrays down to a single array. NOTE: results are not deduped.

Parameters:

  • cb Function

Returns:

Function:

get

(
  • [options]
  • cb
)

Parameters:

  • [options] Object optional
  • cb Function

getAndSerialize

(
  • [options]
  • cb
)

Parameters:

  • [options] Object optional
  • cb Function

getForArticles

(
  • context
  • cb
)

Parameters:

  • context Object
  • cb Function

getForContent

(
  • context
  • options
  • cb
)

Parameters:

  • context Object
  • options Object
  • cb Function

getForPages

(
  • context
  • cb
)

Parameters:

  • context Object
  • cb Function

getForSections

(
  • context
  • cb
)

Parameters:

  • context Object
  • cb Function

getLastModDateStr

(
  • date
)
String static

Formats date objects to a string in the format of: YYYY-MM-DD

Parameters:

  • date Date

Returns:

String:

onPostLoad

(
  • options
  • cb
)
Function static

Returns a function that processes site map items. It calculates the full URL for the item as well as setting the weight and indicating if the items is localized. The returned function accepts two parameters. The first is an error object, if exists. The second is an Array of objects.

Parameters:

  • options Object
    • urlPrefix String
    • weight Decimal
    • localized Boolean
  • cb Function

Returns:

Function:

paddedNumStr

(
  • num
)
String static

Converts the provided number to a string. If the number is less than 10 it is prefix with a '0'.

Parameters:

  • num Integer

Returns:

String:

register

(
  • type
  • callback
)
Boolean static

Registers an item provider. The callback should take two parameters. The first is a context object. The second is callback function.

Parameters:

  • type String
  • callback Function

Returns:

Boolean:

toXml

(
  • items
  • [options]
  • cb
)

Parameters:

  • items Array
  • [options] Object optional
  • cb Function

unregister

(
  • type
)
Boolean static

Unregisters an item provider from the site map service

Parameters:

  • type String

Returns:

Boolean:

Properties

DEFAULT_TEMPLATE

String private static

DEFAULT_URL_TEMPLATE

String private static

onlyThisSite

Boolean

SITE_MAP_REGISTRY

Object private static

siteMapRegistry

Object

The instance of the registry to pull from. Initializes based off of the global configuration

supportedLocales

Array

The locales that are supported for the site as an array of strings

templatePath

String

urlTemplatePath

String