1. Component Guide
  2. Machine readable metadata
  3. Organisation schema with related orgs
Machine readable metadata example

Organisation schema with related orgs

How it looks (preview)

<script type="application/ld+json">
  {
  "@context": "http://schema.org",
  "@type": "GovernmentOrganization",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://www.gov.uk/foo"
  },
  "name": "Magical Artefacts Agency",
  "description": null,
  "parentOrganization": [
    {
      "@context": "http://schema.org",
      "@type": "GovernmentOrganization",
      "sameAs": "https://www.gov.uk/ministry-of-magic"
    }
  ],
  "subOrganization": [
    {
      "@context": "http://schema.org",
      "@type": "GovernmentOrganization",
      "sameAs": "https://www.gov.uk/dodgy-wands-commission"
    }
  ],
  "potentialAction": {
    "@type": "SearchAction",
    "description": "Find all content from Magical Artefacts Agency",
    "target": "https://www.gov.uk/search/all?keywords={query}\u0026order=relevance\u0026organisations%5B%5D=foo",
    "query": "required"
  }
}
</script>

<link rel="canonical" href="https://www.gov.uk/foo" />

<meta property="og:site_name" content="GOV.UK" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://www.gov.uk/foo" />
<meta property="og:title" content="Magical Artefacts Agency" />
<meta property="og:description" content="" />

  <meta name="twitter:card" content="summary" />

How to call this example

<%= render "govuk_publishing_components/components/machine_readable_metadata", {
  content_item: {
    title: "Magical Artefacts Agency",
    base_path: "/foo",
    details: {
    },
    links: {
      ordered_parent_organisations: [
        {
          title: "Ministry of Magic",
          base_path: "/ministry-of-magic"
        }
      ],
      ordered_child_organisations: [
        {
          title: "Dodgy Wands Commission",
          base_path: "/dodgy-wands-commission"
        }
      ]
    }
  },
  schema: "organisation"
} %>