|
2 | 2 |
|
3 | 3 | [](https://github.com/tj-django/django-view-breadcrumbs/actions/workflows/test.yml) [](https://www.codacy.com/gh/tj-django/django-view-breadcrumbs/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-django/django-view-breadcrumbs\&utm_campaign=Badge_Grade) [](https://results.pre-commit.ci/latest/github/tj-django/django-view-breadcrumbs/main) [](https://www.codacy.com/gh/tj-django/django-view-breadcrumbs/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=tj-django/django-view-breadcrumbs\&utm_campaign=Badge_Coverage) [](https://badge.fury.io/py/django-view-breadcrumbs) [](https://pyup.io/repos/github/tj-django/django-view-breadcrumbs/) |
4 | 4 |
|
5 | | -  [](https://pepy.tech/project/django-view-breadcrumbs) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> |
6 | | -[](#contributors-) |
7 | | - |
8 | | -<!-- ALL-CONTRIBUTORS-BADGE:END --> |
9 | | - |
10 | | -Provides a set of breadcrumb mixin classes that can be added to any django view. |
11 | | - |
12 | | -Requires adding `{% render_breadcrumbs %}` to just the base template. |
13 | | - |
14 | | -<img width="1438" alt="breadcrumbs" src="https://user-images.githubusercontent.com/17484350/128493747-776706bf-d46c-4b57-ba54-c64fcc71ada7.png"> |
15 | | - |
16 | | -In the `base.html` template simply add the `render_breadcrumbs` tag and any template |
17 | | -that inherits the base should have breadcrumbs included. |
18 | | - |
19 | | -**Example:** |
20 | | - |
21 | | - my_app |
22 | | - |--templates |
23 | | - |--base.html |
24 | | - |--create.html |
| 5 | +  [](https://pepy.tech/project/django-view-breadcrumbs) |
25 | 6 |
|
26 | | -`base.html` |
27 | | - |
28 | | -```jinja2 |
29 | | -{% load view_breadcrumbs %} |
| 7 | +<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> |
30 | 8 |
|
31 | | -{% block breadcrumbs %} |
32 | | - {% render_breadcrumbs %} {# Optionally provide a custom template e.g {% render_breadcrumbs "view_breadcrumbs/bootstrap5.html" %} #} |
33 | | -{% endblock %} |
34 | | -``` |
35 | | - |
36 | | -And your `create.html`. |
| 9 | +[](#contributors-) |
37 | 10 |
|
38 | | -```jinja2 |
39 | | -{% extends "base.html" %} |
40 | | -``` |
| 11 | +<!-- ALL-CONTRIBUTORS-BADGE:END --> |
41 | 12 |
|
42 | 13 | ## Table of Contents |
43 | 14 |
|
| 15 | +* [Background](#background) |
| 16 | + |
44 | 17 | * [Installation](#installation) |
45 | 18 |
|
46 | 19 | * [Add `view_breadcrumbs` to your INSTALLED\_APPS](#add-view_breadcrumbs-to-your-installed_apps) |
@@ -87,6 +60,37 @@ And your `create.html`. |
87 | 60 |
|
88 | 61 | * [Contributors ✨](#contributors-) |
89 | 62 |
|
| 63 | +## Background |
| 64 | + |
| 65 | +This package provides a set of breadcrumb mixin classes that can be added to any django class based view and requires adding just `{% render_breadcrumbs %}` to the base template. |
| 66 | + |
| 67 | +<img width="1438" alt="breadcrumbs" src="https://user-images.githubusercontent.com/17484350/128493747-776706bf-d46c-4b57-ba54-c64fcc71ada7.png"> |
| 68 | + |
| 69 | +In the `base.html` template add the `render_breadcrumbs` tag and any template that inherits the base should have breadcrumbs included. |
| 70 | + |
| 71 | +**Example:** |
| 72 | + |
| 73 | + my_app |
| 74 | + |--templates |
| 75 | + |--base.html |
| 76 | + |--create.html |
| 77 | + |
| 78 | +`base.html` |
| 79 | + |
| 80 | +```jinja2 |
| 81 | +{% load view_breadcrumbs %} |
| 82 | +
|
| 83 | +{% block breadcrumbs %} |
| 84 | + {% render_breadcrumbs %} {# Optionally provide a custom template e.g {% render_breadcrumbs "view_breadcrumbs/bootstrap5.html" %} #} |
| 85 | +{% endblock %} |
| 86 | +``` |
| 87 | + |
| 88 | +And your `create.html`. |
| 89 | + |
| 90 | +```jinja2 |
| 91 | +{% extends "base.html" %} |
| 92 | +``` |
| 93 | + |
90 | 94 | ## Installation |
91 | 95 |
|
92 | 96 | ```bash |
|
0 commit comments