NHSUK Frontend Styles for Wagtail
Project description
Wagtail NHS.UK frontend
A wagtail implementation of the NHS frontend v2.1.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>
{% breadcrumbs %}
</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-2.1.0.min.js' %}" defer></script>
Further reading
See more documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for wagtail-nhsuk-frontend-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26a3580ab8672a95b35a214f9084f1de339ae99a8e52778e1db8231a4ff4fd9b |
|
MD5 | cf62908bbef69ea76ab9fdcaa8cf9838 |
|
BLAKE2b-256 | 18b4d03aa61ec8360dc8d38ba8370489a0f2f0cbc5f80bf28c14f28f02010767 |