---
title: Add a detail page
project: Pluginable
version: 0.0.1
section: recipes
language: en
license: MIT
url: https://totaljs.es/docs/pluginable/0-0-1/recipes/add-detail-page/
updated: 2026-11-19T07:46:16.024Z
---

# Add a detail page

> Give a plugin a second screen with its own address, such as the page of one item.

A plugin has one main screen, `public/index.html`. Each extra screen is another HTML file in `public` plus a route in `index.js`. The sample plugins use this for the page of one item.

## 1. Add the route

In the plugin `index.js`, list the screen in `exports.routes`:

```js
exports.routes = [
	{ url: '/orders/{id}/', html: 'detail' }
];
```

- `url` is the address under `/admin/`. `{id}` is a part of the address that changes, here the ID of the item.
- `html` is the file name in `public`, without `.html`.

## 2. Add the screen

Create `public/detail.html`. Copy it from `plugins/profiles/public/detail.html` and adapt it. The sample reads the ID from the address and shows it:

```js
exports.reload = function() {
	var params = NAV.params;
	exports.set('id', params[0]);
	exports.refresh();
	BREADCRUMB.add('@(Orders)', '../')('Detail', NAV.url);
};
```

## 3. Link to it

On the main screen, open the detail page with `REDIRECT`. The sample does it when you select an item:

```js
exports.detail = function(el) {
	var id = ATTRD(el);
	REDIRECT('/orders/{0}/'.format(id));
};
```

Restart Pluginable. Select an item in the list: the address changes to `/admin/orders/<id>/` and the breadcrumb shows **Home > Orders > Detail**.
