home / docs / sections

sections: plugin_hooks:plugin-hook-homepage-actions

This data as json

id page ref title content breadcrumbs references
plugin_hooks:plugin-hook-homepage-actions plugin_hooks plugin-hook-homepage-actions homepage_actions(datasette, actor, request) datasette - Datasette class You can use this to access plugin configuration options via datasette.plugin_config(your_plugin_name) , or to execute SQL queries. actor - dictionary or None The currently authenticated actor . request - Request object The current HTTP request. Populates an actions menu on the top-level index homepage of the Datasette instance. This example adds a link an imagined tool for editing the homepage, only for signed in users: from datasette import hookimpl @hookimpl def homepage_actions(datasette, actor): if actor: return [ { "href": datasette.urls.path( "/-/customize-homepage" ), "label": "Customize homepage", } ] ["Plugin hooks", "Action hooks"] []
Powered by Datasette · Queries took 4.85ms