Support and Documentation

Generating data files from published content

You can generate a data file from published content by appending ?_renderer=styleguide to the item's URL. For example, loading an article http://<host>/deadly-gamma-ray-burst-headed-for-mannys-pizzeria?_renderer=styleguide displays the JSON representation of the article's content used to populate a template.

{
  "_exampleOnly" : true,
  "_template" : "/core/article/ArticlePage.hbs",
  "articleBody" : [ {
      "_template" : "/core/article/RichTextArticleBody.hbs",
      "body" : [ "{{html('<p>Asteroid 31415626, known more popularly as \"Fuzzy Bunny,\" escaped its orbit last month and is expected to collide with the Earth on January 21, 2025--precisely one week before the long-anticipated wedding between Jocelyn Rodriguez and Chas O'Brien. The bride-to-be isn't flustered by this development, and asked her bridesmaids to shop for dresses that coordinate well with pulverized concrete and lingering dust clouds.</p>')}}" ],
      "isCached" : false
  } ],
  "datePublished" : "September 05, 2018 09:32 AM",
  "headline" : "Massive Rogue Asteroid On Course to Disrupt Nuptials"
}

The previous snippet is an abbreviated JSON representation of the data used to populate an article's template.

In the previous snippet—

  • Line 2 includes the key _exampleOnly, indicating this JSON file is not for production purposes. Brightspot ignores this file when creating Views.

  • Line 3 indicates the template used to render the content.

  • Lines 4–10 are content keys and associated values taken from a published article.

You can use this file to debug templates and formatting. The advantage to this approach is that you can view your templates with live, published content instead of the mock data in data files—allowing for faster development and deployment.

Procedure. To render a published data file in Styleguide
  1. Copy/paste the rendered JSON file in a Styleguide directory.

    • Leave a blank line at the end of the JSON file.

    • Don't overwrite any existing files.

  2. View the data file in Styleguide. For information about where you can find the template in the Styleguide UI, see Template listing.

The following examples show the difference between two published data files, one rendered in Styleguide, another rendered in production by Brightspot.

Published content rendered in Styleguide
Figure 138. Published content rendered in Styleguide


Published content rendered by Brightspot
Figure 139. Published content rendered by Brightspot