Skip to main content

NHSUK Frontend Styles for Wagtail

Project description

Wagtail NHS.UK frontend

A wagtail implementation of the NHS frontend v10.3.1 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.panels import FieldPanel
from wagtail.models import Page
from wagtail.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()),
  ], use_json_field=True)

  content_panels = Page.content_panels + [
      FieldPanel('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-frontend-10.3.1.min.css' %}">

Include the Javascript in your base template

  <script type="text/javascript" src="{% static 'wagtailnhsukfrontend/js/nhsuk-frontend-10.3.1.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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtail_nhsuk_frontend-2.0.0.tar.gz (89.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wagtail_nhsuk_frontend-2.0.0-py3-none-any.whl (111.8 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_nhsuk_frontend-2.0.0.tar.gz.

File metadata

  • Download URL: wagtail_nhsuk_frontend-2.0.0.tar.gz
  • Upload date:
  • Size: 89.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for wagtail_nhsuk_frontend-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e14d1e622bb731904d64f296a26569d5e4253a1cbce1d5c9b01cbdbd6bcb6a18
MD5 c67344b3326689b5820d2a3a4f24ffa5
BLAKE2b-256 5fa5011913e247007b123e6b03a81818c64bcff641db850c6d5cdc84dd1e747a

See more details on using hashes here.

File details

Details for the file wagtail_nhsuk_frontend-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_nhsuk_frontend-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01780b8022838e53c964592458ceb2fc730900959b8ea7c9947f039ac6c78bd2
MD5 cc78cac7afe09a57bdadcc6e9330b403
BLAKE2b-256 81db14aa0aa7b6796c4ebbb618caa7f1d842f32ce2cae43b20a2dd355bcbba28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page