Class: Doc

Doc

new Doc()

Embodies a document as returned by the API. Most useful fields: id, type, tags, slug, slugs
Source:

Members

alternateLanguages

The alternate language versions of the document
Source:

data

same as fragments
Source:

firstPublicationDate

The first publication date of the document
Source:

fragments

Fragments, converted to business objects
Source:

href :string

The URL of the document in the API
Type:
  • string
Source:

id :string

The ID of the document
Type:
  • string
Source:

lang

The language code of the document
Source:

lastPublicationDate

The last publication date of the document
Source:

rawJSON

raw JSON from the API
Source:

slug :string

The current slug of the document, "-" if none was provided
Type:
  • string
Source:

slugs :array

All the slugs that were ever used by this document (including the current one, at the head)
Type:
  • array
Source:

tags :array

The tags of the document
Type:
  • array
Source:

type :string

The type of the document, corresponds to a document mask defined in the repository
Type:
  • string
Source:

uid :string|null

The User ID of the document, a human readable id
Type:
  • string | null
Source:

Methods

getSliceZone(name) → {Group}

Gets the SliceZone fragment in the current Document object, for further manipulation.
Parameters:
Name Type Description
name string The name of the fragment to get, with its type; for instance, "product.gallery"
Source:
Returns:
- The SliceZone fragment to manipulate.
Type
Group
Example
document.getSliceZone('product.gallery').asHtml(linkResolver).