> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redutzu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pages

> Hide the pages your server doesn't use, and add your own pages to the sidebar.

## Disable pages

Hide pages your server doesn't use, such as **Cameras** or **Radio**. Disabled pages disappear from the sidebar for everyone, and links to them open the home page instead. Their data is kept, so you can turn a page back on any time.

> [tab] Admin panel
>
> **1. Open Interface**
>
> Run `/mdtadmin` and open **Interface**.
>
> **2. Hide pages**
>
> Under **Disabled pages**, pick each page to hide.
>
> ![Disabled pages picker in the admin panel](https://mintcdn.com/redutzusscripts/jYySSRvwCjpWaAJk/images/guides/pages-disabled.webp?fit=max\&auto=format\&n=jYySSRvwCjpWaAJk\&q=85\&s=1c77ff37df71df13db46fbbc33d13909)
>
> Hiding pages in the Interface section
>
> The sidebar updates instantly for every officer.

> [tab] config.lua
>
> ```lua config/config.lua theme={null}
> Config.DisabledPages = { 'cameras', 'radio' }
> ```
>
> Restart the resource to apply the change.

> [accordion] Page names
>
> `dashboard`, `dispatch`, `radio`, `cameras`, `announcements`, `incidents`, `evidences`, `warrants`, `bolos`, `citizens`, `vehicles`, `houses`, `weapons`, `officers`, `penalcode`, `penalties`, `prisoners`, `operationplans`, `templates`, `logs`, `employees`, `management`, `config`

> [!TIP]
>
> To hide a page from only some ranks, don't disable it. Remove its `.view` permission from those grades instead. See [Permissions](https://docs.redutzu.com/redutzu-mdt/guides/permissions.md).

## Add your own pages

Custom pages open a website inside the MDT, such as a department wiki, rules, or your own tool. Each page gets its own entry in the sidebar.

![MDT showing a custom page and its sidebar entry](https://mintcdn.com/redutzusscripts/jYySSRvwCjpWaAJk/images/guides/custom-page-result.webp?fit=max\&auto=format\&n=jYySSRvwCjpWaAJk\&q=85\&s=c254554e16e91f38a8c227282856e8e5)

A custom page open in the MDT

There are two ways to add one:

| Method | Use it for |
| - | - |
| [Admin panel or config](#from-the-admin-panel-or-config) | A website that's already online, such as a Google Doc or wiki. |
| [`RegisterPage` export](#from-a-resource) | A page built into your own FiveM resource. |

### From the admin panel or config

> [tab] Admin panel
>
> **1. Open Interface**
>
> Run `/mdtadmin`, open **Interface**, and find **Custom pages**.
>
> **2. Add a page**
>
> Fill in the name, sidebar text, and website address. The other fields are optional. The preview shows how the sidebar will look.
>
> **3. Choose who sees it**
>
> Pick a permission, or type your own, such as `wiki.view`. Leave it empty to show the page to every officer.
>
> ![Custom pages form in the admin panel](https://mintcdn.com/redutzusscripts/jYySSRvwCjpWaAJk/images/guides/custom-page-form.webp?fit=max\&auto=format\&n=jYySSRvwCjpWaAJk\&q=85\&s=8556d163723e2b5d2d4d5fab96044b94)
>
> Adding a custom page, with the sidebar preview

> [tab] config.lua
>
> ```lua config/config.lua theme={null}
> Config.CustomPages = {
>     {
>         name = 'handbook',
>         label = 'Handbook',
>         url = 'https://docs.example.com/handbook',
>         icon = 'book-open',
>         category = 'department',
>         title = 'Department handbook',
>         subtitle = 'Rules and procedures',
>         permission = 'handbook.view'
>     }
> }
> ```
>
> Restart the resource to apply the change.

| Field | Required | Description |
| - | - | - |
| `name` | Yes | Unique id, used in the page's address. Lowercase letters, numbers, `_`, and `-`. |
| `label` | Yes | Text shown in the sidebar. |
| `url` | Yes | Website to open. Starts with `https://`. |
| `icon` | No | A [Lucide](https://lucide.dev/icons) icon name, such as `book-open`. |
| `category` | No | Sidebar group. Pages with the same category are listed together. Defaults to `custom`. |
| `title` | No | Heading above the page. Defaults to `label`. |
| `subtitle` | No | Small text under the heading. |
| `permission` | No | Permission needed to see the page. Empty shows it to every officer. |

> [!WARNING]
>
> Some websites block being shown inside other pages, such as most Google pages and sites with strict security headers. If a page stays blank, open the browser console with F8 to check. Use a site that allows embedding, or host the page in a resource.

### From a resource

Call `RegisterPage` on the client to add a page from your own resource. The page is removed automatically when your resource stops.

```lua client.lua theme={null}
exports['redutzu-mdt']:RegisterPage({
    name = 'my-plugin',
    label = 'My plugin',
    icon = 'puzzle',
    url = ('https://cfx-nui-%s/web/index.html'):format(GetCurrentResourceName()),
    permission = 'myplugin.view'
})
```

It takes the same fields as the table above. Without a `permission`, the page needs `dashboard.view`.

To serve the page from your resource, add its files to your `fxmanifest.lua`:

```lua fxmanifest.lua theme={null}
files {
    'web/index.html',
    'web/**/*'
}
```

To remove the page yourself, call `UnregisterPage` with its name:

```lua client.lua theme={null}
exports['redutzu-mdt']:UnregisterPage('my-plugin')
```

## Give officers access

A custom permission such as `myplugin.view` doesn't belong to anyone yet. Add it to `config/permissions.json`, on the lowest grade that should see the page, in every job that should use it. The in-game permission editors only list built-in permissions, so custom ones go in the file.

```json config/permissions.json theme={null}
{
    "police": {
        "0": ["dashboard.view", "myplugin.view"]
    },
    "sheriff": {
        "2": ["myplugin.view"]
    }
}
```

Here every police officer sees the page, and sheriffs see it from grade `2` up. Restart the resource, or call [`ReloadPermissions`](https://docs.redutzu.com/redutzu-mdt/api-reference/exports/server#reloadpermissions) to apply it without a restart. See [Permissions](https://docs.redutzu.com/redutzu-mdt/guides/permissions.md) for how grades work.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.