Jump to content

Developer Documentation

Getting content from a Content Item

If you use content items in your application, it probably goes without saying that you'll want to use the content within those items at some point. There's two possibilities depending on whether your model uses a specific column for content, or expects the first comment to act as the content (such as in the Forums application).

For a specific content field

Simply add a content key to the $databaseColumnMap, with the value being the column in the database that contains the content.

For comments as the content

When you implement content comments, the first comment will automatically be treated as the item's content.

 

Methods available for working with content

string content()

Returns the value of the content.

 

string truncated( [ boolean $oneLine=FALSE ] )

Returns the content in a format suitable for use with the data-ipsTruncate widget.

  • $oneLine (boolean, optional, default FALSE)
    By default, paragraphs are turned into line break. If this parameter is TRUEparagraphs are replaced with spaces instead of line breaks, making the truncated content suitable for a one-line display.

  Report Document


×
×
  • Create New...