alphagov/content-store — pull request #51 by fatbusinessman (2014-09-25 22:16:39+00:00)
Title: Show linked items in published content

When submitting an item to the content store, publishing tools can now provide a `links` field, containing a hash of link types to arrays of content IDs. For example:

"links": {
"related": ["8242a29f-8ad1-4fbe-9f71-f9e57ea5f1ea", "9f99d6d0-8f3b-4ad1-aac0-4811be80de47"]
}

When these content IDs correspond to items already in the content store, they get pulled out on the site side and displayed with titles, API URLs and site URLs.

Part of this work involved converting the presentation logic from a single `as_json` method on the `ContentItem` model to a public view (which looks up content items) and a private view (for responses to publishing tools, and notifications to the message queue), both implemented in presenter classes.