3.5 Customizing on-page displays

On-page menu : how to define which items are displayed

Available items

"Add metadata" button
"Import notes" button
"View item information" button
Opens the item in the library search panel.
"Open in Zotero (local)" button
Link to the item in Zotero (standalone app).
"Open in Zotero (web)" button
Link to the item in Zotero (web library).
Links to each PDF attachment for the item
Scite.ai badge of citations (mentioning, supporting, contrasting)
Link to the item on ConnectedPapers
Link to the item on Semantic Scholar
Link to the item on Google Scholar
List of items which cite the current item, in Zotero library + elsewhere.

In the code

// Add a 'pageMenu' setting, with its 'defaults' property as an Array of options
zoteroRoam_settings = {
// dataRequests: [...],
pageMenu: {
defaults: ["addMetadata", "importNotes", "viewItemInfo", "pdfLinks"]

Display triggers

You can choose which pages should display the on-page menu/contextual buttons, by defining a trigger function. The function should take as its only argument the title of the page, and return a Boolean (true | false).
// By default, the on-page displays will only be shown if the page title
// is more than 3 characters in length, to avoid wasteful lookups
zoteroRoam_settings = {
// dataRequests: [...],
pageMenu: {
trigger: (title) => {
return title.length > 3 ? true : false;
The title will be the full title of the Roam page - if the page is in citekey format (@citekey), that will include the @. The trigger function can be as simple or as complex as needed : different rules could be written for DNPs vs. regular pages, for example, or the Roam Alpha API could be used to check the page's contents, run queries on the graph...