Admin layout example

With type module

Adds ‘type=module’ to the javascript_include_tag. By default, use_type_module is false.

How it looks (preview)

<!DOCTYPE html>
<html lang="en" class="govuk-template govuk-template--rebranded">
  <head>
    <meta charset="utf-8">
    <title>A page title - GOV.UK Publishing</title>
    <meta name="robots" content="noindex,nofollow,noimageindex">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <link rel="icon" type="image/x-icon" href="/assets/government-frontend/govuk_publishing_components/favicon-production-f24c2313e8823e049575a8960114d0c48d6638f023ce171650bc471aa7ab420c.png" />
    <link rel="stylesheet" href="/assets/government-frontend/application-3884c2a1e8c063c2a7ac9d170e4e3b4555dc8bfc32b1bc7e7f9fd231b3c79baf.css" media="all" />
    
  </head>
  <body class="gem-c-layout-for-admin govuk-template__body">
    <script nonce="c4S9PnJevx+76GJShQYsng==">
//<![CDATA[
      document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');

//]]>
</script>    
      <!-- You probably want to use the header, main & footer components here -->


      <script src="/assets/government-frontend/application-7c9db67f200545f0155ed150d5333b474479b0b3eb482c430af7f62aa560e563.js" type="module"></script>
  </body>
</html>

How to call this example

<%= render "govuk_publishing_components/components/layout_for_admin", {
  environment: "production",
  product_name: "Publishing",
  browser_title: "A page title",
  use_type_module: true
} do %>
  <!-- You probably want to use the header, main & footer components here -->
<% end %>