API Docs for: 0.8.0
Show:

ArticleRenderer Class

Retrieves the necessary data as well as prepares the layout so a view loader can complete the render of content

Constructor

ArticleRenderer

(
  • context
)

Parameters:

  • context Object
    • hostname String
    • site String
    • onlyThisSite Boolean
    • [userService] UserService optional

Methods

containsReadMoreFlag

(
  • content
)
Boolean

Parameters:

  • content Object

Returns:

Boolean:

formatAutoBreak

(
  • content
  • context
)

Parameters:

  • content Object
  • context Object

formatBylines

(
  • content
  • context
)

Parameters:

  • content Object
  • context Object

formatComments

(
  • content
  • context
  • cb
)

Parameters:

  • content Object
  • context Object
  • cb Function

formatLayout

(
  • content
  • context
)

Parameters:

  • content Object
  • context Object

formatLayoutForReadMore

(
  • content
  • context
)

Parameters:

  • content Object
  • context Object
    • readMore Boolean

formatMediaReferences

(
  • content
  • context
  • cb
)

Parameters:

  • content Object
  • context Object
  • cb Function

formatTimestamp

(
  • content
  • context
)

Parameters:

  • content Object
  • context Object

getCommenters

(
  • comments
  • contentSettings
  • cb
)

Retrieves the commenters for an array of comments

Parameters:

  • comments Array

    Array of comment objects

  • contentSettings Object

    Content settings to use for processing

  • cb Function

    Callback function

getContentLinkPrefix

() String

Returns:

String:

getLayout

(
  • content
)
String

Retrieves the layout from the content object. Provides a mechanism to allow for layout parameter to have any name.

Parameters:

  • content Object

Returns:

String:

getReadMoreSpan

(
  • content
  • anchorContent
)
String

Parameters:

  • content Object
  • anchorContent String

Returns:

String:

render

(
  • content
  • context
  • cb
)

Parameters:

  • content Object
  • context Object
    • [authors] Object optional

      A hash of user objects representing the authors of the content to be rendered

    • contentSettings Object

      The content settings

    • contentCount Integer

      An integer representing the total number of content objects that will be processed for this request

    • [renderBylines=true] Boolean optional
    • [renderTimestamp=true] Boolean optional
    • [renderComments=true] Boolean optional
    • [readMore=false] Boolean optional
  • cb Function

setLayout

(
  • content
  • layout
)

A workaround to allow this prototype to operate on articles and pages. The layout parameter is not the same. Until we introduce breaking changes this will have to do.

Parameters:

  • content Object
  • layout String

Properties

ANONYMOUS_COMMENTER

String private static

READ_MORE_FLAG

String private static

userService

UserService

Instance of user service. No context is provided and therefore can only be used