# 3.5 Customizing on-page displays

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

### Available items

| Name                | Content                                                                                            |
| ------------------- | -------------------------------------------------------------------------------------------------- |
| `"addMetadata"`     | "Add metadata" button                                                                              |
| `"importNotes"`     | "Import notes" button                                                                              |
| `"viewItemInfo"`    | <p>"View item information" button</p><p><em>Opens the item in the library search panel.</em></p>   |
| `"openZoteroLocal"` | <p>"Open in Zotero (local)" button</p><p><em>Link to the item in Zotero (standalone app).</em></p> |
| `"openZoteroWeb"`   | <p>"Open in Zotero (web)" button</p><p><em>Link to the item in Zotero (web library).</em></p>      |
| `"pdfLinks"`        | Links to each PDF attachment for the item                                                          |
| `"sciteBadge"`      | [Scite.ai](https://scite.ai) badge of citations (mentioning, supporting, contrasting)              |
| `"connectedPapers"` | Link to the item on ConnectedPapers                                                                |
| `"semanticScholar"` | Link to the item on Semantic Scholar                                                               |
| `"googleScholar"`   | Link to the item on Google Scholar                                                                 |
| `"citingPapers"`    | List of items which cite the current item, in Zotero library + elsewhere.                          |

### In the code

```javascript
// 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`).

```javascript
// 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;            
        }
    }
}
```

{% hint style="info" %}
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...
{% endhint %}
