Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

A wagtail implementation of the NHS.UK frontend library

License

Notifications You must be signed in to change notification settings

nhsuk-archive/dct-wagtail-nhsuk-frontend

 
 

Repository files navigation

Wagtail NHS.UK frontend

A wagtail implementation of the NHS frontend v3.0.4 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/wagtail-nhsuk-frontend.min.css' %}">

Include the Javascript in your base template

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

Contributing

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

Further reading

See more documentation

About

A wagtail implementation of the NHS.UK frontend library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 81.4%
  • HTML 17.9%
  • Other 0.7%