SiteMapService Class
Constructor
SiteMapService
-
context
Parameters:
-
contextObject-
tsTemplateService -
lsLocalization -
articleServiceArticleServiceV2 -
pageServicePageService -
siteStringThe site UID
-
onlyThisSiteBoolean -
templatePathString -
urlTemplatePathString -
[supportedLocales]Array optional
-
Item Index
Methods
- _serializeItems
- createAlternateLinks static
- formatGetResults static
- get
- getAndSerialize
- getForArticles
- getForContent
- getForPages
- getForSections
- getLastModDateStr static
- onPostLoad static
- paddedNumStr static
- register static
- serializeLocaleLink static
- toXml
- unregister static
Properties
Methods
_serializeItems
-
items -
cb
Parameters:
-
itemsArray -
cbFunction
createAlternateLinks
-
item -
currentLocale -
locales -
hostname
Takes a site map item and inspects its localized property. If it evaluates to TRUE then the XML elements are generated that match the allowed locales
Parameters:
-
itemObject -
currentLocaleString -
localesArray -
hostnameString
Returns:
formatGetResults
-
cb
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:
-
cbFunction
Returns:
get
-
[options] -
cb
Parameters:
-
[options]Object optional -
cbFunction
getAndSerialize
-
[options] -
cb
Parameters:
-
[options]Object optional -
cbFunction
getForArticles
-
context -
cb
Parameters:
-
contextObject -
cbFunction
getForContent
-
context -
options -
cb
Parameters:
-
contextObject -
optionsObject -
cbFunction
getForPages
-
context -
cb
Parameters:
-
contextObject -
cbFunction
getForSections
-
context -
cb
Parameters:
-
contextObject -
cbFunction
getLastModDateStr
-
date
Formats date objects to a string in the format of: YYYY-MM-DD
Parameters:
-
dateDate
Returns:
onPostLoad
-
options -
cb
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:
-
optionsObject-
urlPrefixString -
weightDecimal -
localizedBoolean
-
-
cbFunction
Returns:
paddedNumStr
-
num
Converts the provided number to a string. If the number is less than 10 it is prefix with a '0'.
Parameters:
-
numInteger
Returns:
register
-
type -
callback
Registers an item provider. The callback should take two parameters. The first is a context object. The second is callback function.
Parameters:
-
typeString -
callbackFunction
Returns:
serializeLocaleLink
-
context
Takes the provided relationship, locale, and URL to generate an XML element to represent the alternate link for a site map
Parameters:
-
contextObject-
relationshipString -
localeString -
urlString
-
Returns:
toXml
-
items -
[options] -
cb
Parameters:
-
itemsArray -
[options]Object optional -
cbFunction
unregister
-
type
Unregisters an item provider from the site map service
Parameters:
-
typeString
Returns:
Properties
DEFAULT_TEMPLATE
String
private
static
DEFAULT_URL_TEMPLATE
String
private
static
onlyThisSite
Boolean
site
String
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
