Skip to content

Commit

Permalink
adjust nav template examples
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas committed Feb 23, 2024
1 parent a567df0 commit 27572da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,12 @@
```htmldjango
<!-- base.html -->
{% load django_simple_nav %}
{% block navigation %}
<nav>
{% django_simple_nav "path.to.MainNav" %}
</nav>
{% endblock navigation %}
```

The template tag can either take a string representing the import path to your navigation definition or an instance of your navigation class:
Expand All @@ -173,18 +176,23 @@
```

```htmldjango
<!-- base.html -->
<!-- example_app/example_template.html -->
{% extends "base.html" %}
{% load django_simple_nav %}
{% block navigation %}
<nav>
{% django_simple_nav nav %}
</nav>
{% endblock navigation %}
```

Additionally, the template tag can take a second argument to specify the template to use for rendering the navigation. This is useful if you want to use the same navigation structure in multiple places but render it differently.

```htmldjango
<!-- base.html -->
{% load django_simple_nav %}
<footer>
{% django_simple_nav "path.to.MainNav" "footer_nav.html" %}
</footer>
Expand Down

0 comments on commit 27572da

Please sign in to comment.