datasette: Ability for plugins to collaborate when adding extra HTML to blocks in default templates
Sometimes a plugin may want to add content to an existing default template - for example datasette-search-all adds a new search box at the top of index.html. I also want datasette-upload-csvs to add a CTA on the database.html page: https://github.com/simonw/datasette-upload-csvs/issues/18
Currently plugins can do this by providing a new version of the index.html template - but if multiple plugins try to do that only one of them will succeed.
It would be better if there were known areas of those templates which plugins could add additional content to, such that multiple plugins can use the same spot.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 20 (20 by maintainers)
Commits related to this issue
- Implemented macro for #1191 — committed to simonw/datasette by simonw 3 years ago
- top_homepage() plugin hook, refs #1191 — committed to simonw/datasette by simonw 5 months ago
- Docs for top_query v top_canned_query, refs #1191 — committed to simonw/datasette by simonw 5 months ago
- Template slot family of plugin hooks - top_homepage() and others New plugin hooks: top_homepage top_database top_table top_row top_query top_canned_query New datasette.utils.make_slot_func... — committed to sthagen/simonw-datasette by simonw 5 months ago
Preview of the documentation, showing all of the planned hooks: https://datasette--2238.org.readthedocs.build/en/2238/plugin_hooks.html#top-homepage-datasette-request