-
-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a universal navigation bar which can be modified by plugins #540
Comments
Need to figure out a sensible mobile version of this too. |
Having this be customized by a single plugin seems easy enough - define a named block region in the template, the plugin can then provide a template which extends the base template, over-rides the named block, adds some stuff, then calls super to include the default content. But... how would this work if there are multiple plugins that want to add to the menu area? |
For the moment I'm going to ignore the multiple plugins case. I shall revisit that at some point in the future, once I actually have multiple plugins that want to be able to customize the navigation at the same time. |
https://latest.datasette.io/fixtures/attraction_characteristic/1 now looks like this: |
Here's an example custom {% extends "default:base.html" %}
{% block extra_head %}
<style type="text/css">
.hd .logout {
float: right;
text-align: right;
padding-left: 1em;
}
</style>
{% endblock %}
{% block nav %}
{{ super() }}
<p class="logout">
<a href="/-/logout">Log out</a>
</p>
{% endblock %} |
This is now being used successfully by https://datasette-auth-demo.now.sh/ |
Needed by simonw/datasette-auth-github#5
We already have a navigation breadcrumbs header on some pages, I can extend that to be present on every page and make it easy to modify with custom templates.
The text was updated successfully, but these errors were encountered: