Configuring additional data formats

In Content Manager Explorer, the Site Configuration Component can have a named property dataFormats, set to a comma-separated list of the additional data format(s) in which you want to serve your content.

Procedure

  1. Access the Content Manager Explorer Web site.
  2. In the folder tree, in the 100 Master Publication, navigate to Building Blocks/Folder.Core/Site Manager/.
  3. Open the Component called Site Configuration.
  4. Under Settings, ensure the presence of a name-value pair in which Name is set to dataFormats.
  5. Set the Value field of this name-value pair to a comma-separated list of one or more of the following values:
    json

    Include this format to serve up content in the JSON format. The JSON version of a page is a direct deserialization of the page, region and entity models used to render the page. This does include entities that are partially or fully populated with dynamic data (such as Content Broker query results or search results).

    rss

    Include this format to serve up content in the RSS format. The RSS output includes a feed title and description, taken from the page's metadata, and a list of feed items based on Teasers found on the page.

    Teasers on the page can be identified in the following ways:
    • An entity on the page can be a Teaser
    • A semantic entity of type http://schema.org/ItemList can contain a list of Teasers as one of its properties
    • A Teaser can be built from various named properties on the page: Name of Headline for the Teaser title, Link or Url for the Teaser link, Date for the Teaser publish date, and Description for the teaser text.
    atom

    Include this format to serve up content in the Atom format. The Atom output is equivalent to the RSS output.

    A custom format

    Include the name of a custom format you created and registered yourself in order for the Web site to serve up content in that format

  6. Click Save and Close to commit your changes and close the dialog.
  7. In your Web site Publication, navigate to the Home/_System folder.
  8. Republish the Page called Publish Settings and refresh your site.

Results

The site serves up content in the format(s) you specified. To retrieve content in a specific format, do one of the following:
  • Append the query string format=FORMAT, where FORMAT is the name of the format, to the end of your URL.
  • Use the accept headers in the request to determine the format. For example, include an accept header application/rss+xml or application/atom+xml to get RSS or ATOM format output, respectively, or, for JSON, add the following JQuery code in your browser console to produce in a message box containing the JSON version of the page: $.getJSON("http://www.example.com/articles/news", function(data){alert(JSON.stringify(data));})