Skip to content
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

multiple plugins extending the same base template? #2357

Open
epaulson opened this issue Jun 18, 2024 · 0 comments
Open

multiple plugins extending the same base template? #2357

epaulson opened this issue Jun 18, 2024 · 0 comments

Comments

@epaulson
Copy link

I am trying to build my own plugin that will extend the table template, but I think I'm stuck on some sort of conflict with other plugins that also extend the table template, like the write-ui. Logged in as root with the write-ui plugin installed, I see an 'add new row' button on my table page.

Just as a test, I made a trivial template table.html in my plugin's template/ directory:

{% extends "default:table.html" %}

{% block content %}
<h1>TABLE EXTRA HTML AT THE TOP OF THE CONTENT BLOCK</h1>
<p>This line renders the original block:</p>
{{ super() }}
{% endblock %}

but if I have the datasette-write-ui plugin installed, I don't see the TABLE EXTRA HTML text.

However, even with the datasette-write-ui plugin installed, if I have a row.html file in my plugin's template/ directory, this works:

{% extends "default:row.html" %}

{% block content %}
<h1>ROW EXTRA HTML AT THE TOP OF THE CONTENT BLOCK</h1>
<p>This line renders the original block:</p>
{{ super() }}
{% endblock %}

If I uninstall datasette-write-ui, then I see my trivial table template.

If I then reinstall the datasette-write-ui plugin, this time I still see the TABLE EXTRA HTML text but the 'Add new row' button is not rendered. If I remove the table.html file from my plugins templates/ directory without making any other changes, then the 'Add new row' button returns.

For now it's not a big deal for me, I just won't have the write-ui plugin installed while I'm using my plugin, but if there's something better I can do so my plugin can coexist with other plugins, I would appreciate any direction you can point me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant