1. Government Frontend Component Guide
  2. Publisher metadata

Component

Publisher metadata

Lists publication dates and publishers.

A replacement for the metadata component with only the publisher details. Dates are rendered by the published dates component.

Part of the universal navigation design.

Search for usage of this component on GitHub

How it looks (preview all)

How to call this component

<%= render "components/publisher-metadata", {
  published: "31 July 2017",
  last_updated: "20 September 2017",
  other: {
    from: [
      sanitize("<a href='/government/organisations/ministry-of-defence'>Ministry of Defence</a>")
    ]
  }
} %>

Accessibility acceptance criteria

Links in the component must:

  • accept focus
  • be focusable with a keyboard
  • be usable with a keyboard
  • indicate when they have focus
  • change in appearance when touched (in the touch-down state)
  • change in appearance when hovered
  • be usable with touch
  • be usable with voice commands
  • have visible text

Other examples

With history link (preview)

<%= render "components/publisher-metadata", {
  published: "31 July 2017",
  last_updated: "20 September 2017",
  link_to_history: true,
  other: {
    from: [
      sanitize("<a href='/government/organisations/ministry-of-defence'>Ministry of Defence</a>")
    ]
  }
} %>

No last updated (preview)

<%= render "components/publisher-metadata", {
  published: "31 July 2017"
} %>

No publishers (preview)

<%= render "components/publisher-metadata", {
  published: "31 July 2017",
  last_updated: "20 September 2017",
  link_to_history: true
} %>

Two publishers (preview)

<%= render "components/publisher-metadata", {
  published: "31 July 2017",
  last_updated: "20 September 2017",
  other: {
    from: [
      sanitize("<a href='/government/organisations/department-for-education'>Department for Education</a>"),
      sanitize("<a href='/government/organisations/education-funding-agency'>Education Funding Agency</a>")
    ]
  }
} %>

Multiple publishers and no link to history (preview)

<%= render "components/publisher-metadata", {
  published: "31 July 2017",
  last_updated: "20 September 2017",
  other: {
    from: [
      sanitize("<a href='/government/organisations/department-for-education'>Department for Education</a>"),
      sanitize("<a href='/government/organisations/education-funding-agency'>Education Funding Agency</a>"),
      sanitize("<a href='/government/organisations/department-for-work-pensions'>Department for Work and Pensions</a>")
    ]
  }
} %>

One collection (preview)

<%= render "components/publisher-metadata", {
  other: {
    collections: [
      sanitize("<a href='/government/collections/tribunals-statistics'>Tribunals statistics</a>")
    ]
  }
} %>

Two collections (preview)

<%= render "components/publisher-metadata", {
  other: {
    collections: [
      sanitize("<a href='/government/collections/tribunals-statistics'>Tribunals statistics</a>"),
      sanitize("<a href='/government/collections/civil-justice-statistics-quarterly'>Civil justice statistics quarterly</a>")
    ]
  }
} %>

More than two collections (preview)

<%= render "components/publisher-metadata", {
  other: {
    collections: [
      sanitize("<a href='/government/collections/tribunals-statistics'>Tribunals statistics</a>"),
      sanitize("<a href='/government/collections/civil-justice-statistics-quarterly'>Civil justice statistics quarterly</a>"),
      sanitize("<a href='/government/collections/offender-management-statistics-quarterly'>Offender management statistics quarterly</a>")
    ]
  }
} %>

Nothing (preview)

If an other object is provided with keys that have no values the component does not render.

<%= render "components/publisher-metadata", {
  other: {
    From: null,
    Another: [

    ],
    "Empty thing": false,
    "Also empty": {
    }
  }
} %>

National applicability (preview)

<%= render "components/publisher-metadata", {
  other: {
    "Applies to": sanitize("England, Scotland, and Wales (see detailed guidance for <a href=\"http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for\" rel=\"external\">Northern Ireland</a>)")
  }
} %>

Right to left (preview)

<%= render "components/publisher-metadata", {
  published: "31 July 2017",
  last_updated: "20 September 2017",
  other: {
    from: [
      sanitize("<a href='/government/organisations/ministry-of-defence'>Ministry of Defence</a>")
    ]
  }
} %>