Skip to main content

Wagtail NHS.UK frontend

A wagtail implementation of the NHS frontend v5.2.0 standard components.

Installation

Install the pypi package

pip install wagtail-nhsuk-frontend

Add to your INSTALLED_APPS in wagtail settings

INSTALLED_APPS = [
  ...

  'wagtailnhsukfrontend',

  ...
]

Use blocks in your streamfields

from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.core.models import Page
from wagtail.core.fields import StreamField

from wagtailnhsukfrontend.blocks import ActionLinkBlock, WarningCalloutBlock

class HomePage(Page):
  body = StreamField([
      # Include any of the blocks you want to use.
      ('action_link', ActionLinkBlock()),
      ('callout', WarningCalloutBlock()),
  ])

  content_panels = Page.content_panels + [
      StreamFieldPanel('body'),
  ]

Use templatetags

{% load nhsukfrontend_tags %}

<html>
...
<body>
  {% breadcrumb %}
</body>
</html>

Use template includes

{% include 'wagtailnhsukfrontend/header.html' with show_search=True %}

See the component documentation for a list of components you can use.

Include the CSS in your base template

  <link rel="stylesheet" type="text/css" href="{% static 'wagtailnhsukfrontend/css/nhsuk.min.css' %}">

Include the Javascript in your base template

  <script type="text/javascript" src="{% static 'wagtailnhsukfrontend/js/nhsuk.min.js' %}" defer></script>

Upgrading

If you are upgrading from v0 to v1, see the changelog.

This CSS and JS is taken directly from the nhsuk-frontend library and provided in this package for convenience.

If you have a more complicated frontend build such as compiling your own custom styles, you might want to install from npm instead.

Contributing

See the contributing documentation to run the application locally and contribute changes.

Further reading

See more documentation

Metadata

Release files for wagtail-nhsuk-frontend 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wagtail-nhsuk-frontend 1.2.1
File Size Uploaded
wagtail-nhsuk-frontend-1.2.1.zip 96.7 kB Details

Release files / wagtail-nhsuk-frontend-1.2.1.zip

Download URL wagtail-nhsuk-frontend-1.2.1.zip
Size 96.7 kB
Tags Source
SHA-256 checksum
How to use checksums
63e33ec897cd78677ae2a3ac7f8f3b58521774c91ff01635b787ebfc63420608
BLAKE2b-256 checksum
How to use checksums
f00a01faca3e530d5e1d54c1d0d68bf1f376cff487f110725b81a4b694270c4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.3

1 release file

1.2.2

1 release file

This release

1.2.1 This release

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.5.0

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page