API Navigation
API Navigation builds a jump-link list of every Endpoint block on the current page automatically, with no manual list to maintain. Add every endpoint to the page first, then drop this block in wherever you want the list to appear, and it fills itself in from the method and path of each Endpoint block it finds.
Adding the block#
- Make sure every Endpoint block you want listed is already on the page.
- In the block editor, open the block inserter and search for API Navigation.
- Add it wherever you want the jump-link list to appear, usually near the top of the page.
- Give it a title if you want one, and choose whether deprecated endpoints should be included.
Settings#
| Setting | What it does |
|---|---|
| Title | Heading shown above the list, e.g. Endpoints. Optional. |
| Include deprecated endpoints | On by default. Turn off to hide any Endpoint block marked deprecated from this list. |
Each list item is built from that endpoint’s own method and path, and links down the page to it. There’s nothing to fill in per endpoint here.
Example#
A page with two Endpoint blocks already on it (GET /customers and POST /customers), and an API Navigation block with Title set to Endpoints.
The block#
In the editor, this is just the API Navigation block dropped onto the page, with a title set if you want one. It fills in from the Endpoint blocks already there, no code required.
The shortcode#
The same block, added as a shortcode instead, for a widget, classic-editor content, or a page builder that only accepts shortcodes. Every setting here is a plain value, not a JSON array, so it can go in a quoted attribute as usual:
[nahnu_code_block block="api-navigation" title="Endpoints"]
The block attribute picks which block to render (api-navigation here); title maps to that block’s own setting by name.
How it renders#
A list titled “Endpoints”, with one linked row per Endpoint block on the page: a method badge, the path, and a jump link down to that endpoint.
Tips#
- This block only finds Endpoint blocks added through the block editor. An endpoint added as a
[ nahnu_code_block block="endpoint" ... ]shortcode instead won’t show up in the list, since the list is built from the page’s actual blocks, not its shortcodes. - Add every Endpoint block to the page before adding this one, so the list is complete the first time you check it.
- Leave Include deprecated endpoints on unless you specifically want a clean, current-only list for readers.