Wagtail Header
Full navigation header, menus, sub menus, internal and external links and documents, simple integrated design.
Version Python: ^3
Version django: ^3
Version wagtail: ^2.8
Installation
pip install menu_header_wagtail- Add
menu_header_wagtailto your installed apps - Run migrations
./ manage.py migrate
Usage
- Import in models of app
my_app/models.py
from menu_header_wagtail.models import HeaderPage
- Add the model
HeaderPageto the page model asForeignKeyin your HomePage or other pages
class HomePage(Page):
header = models.ForeignKey(
HeaderPage,
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)
...
and then in content
...
content_panels = Page.content_panels + [
SnippetChooserPanel('header'),
...
]
And to render:
- Load tag and pass param page
{% load menu_header_wagtail_tag %}
{% render_header_ui page %}
NOTE: If you have nested pages, then use the get_parent_page tag and the child page as a parameter.
When you get it, you must indicate the type of page that the parent is: page_parent.{type_page}
{% get_parent_page page as page_parent %}
{% render_header page_parent.homepage %}
- And finally, stop and start server
Using this type of menu is important because it allows you to reuse as well as create different ones for different pages.
Made with ♥ by Jose Florez
Metadata
Release files for menu-header-wagtail 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| menu_header_wagtail-1.0.1.tar.gz | 11.2 kB | Without provenance | Details for menu_header_wagtail-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| menu_header_wagtail-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for menu_header_wagtail-1.0.1-py3-none-any.whl |
Total release size: 26.8 kB
Security for menu-header-wagtail 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.