issues: 663228985
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | pull_request | body | repo | type | active_lock_reason | performed_via_github_app | reactions | draft | state_reason |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
663228985 | MDU6SXNzdWU2NjMyMjg5ODU= | 904 | datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates | 9599 | closed | 0 | 6026070 | 11 | 2020-07-21T18:42:52Z | 2020-10-23T19:44:05Z | 2020-10-20T00:51:51Z | OWNER | I tried using this block of template in a plugin and got an error: ```html {% block nav %} <p class="crumbs"> <a href="{{ base_url }}">home</a> / <a href="{{ database_url(database) }}">{{ database }}</a> / <a href="{{ database_url(database) }}/{{ table|quote_plus }}">{{ table }}</a> </p> {{ super() }} {% endblock %} ``` Error: `'database_url' is undefined` That's because `database_url` is only made available by the BaseView template here: https://github.com/simonw/datasette/blob/d6e03b04302a0852e7133dc030eab50177c37be7/datasette/views/base.py#L110-L125 | 107914493 | issue | {"url": "https://api.github.com/repos/simonw/datasette/issues/904/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | completed |