Custom Pages
Departments can add their own pages to the MDT: handbooks, penal code write-ups, guides, training material or any document they already keep somewhere else.
Every page belongs to the department it was created in and decides on its own who can see it.
Developers can also add their own resource's UI to the MDT as a tab, see Tablet Apps (External UI).
Giving a rank access
- Run
/mdt-adminand unlock Create/Edit Custom Pages for the department. - Open the MDT, go to Department Settings and assign Create/Edit Custom Pages to the ranks that should write pages.
Those ranks now get a Page Library in the MDT with a New Page button. They can always see and edit every page of the department, whatever access the page has.
Page types
| Type | What it is |
|---|---|
| Document | Written inside the MDT. Split it into sections, each with its own title. Readers get a sidebar with all sections, a search box and Previous / Next buttons. |
| External Link | Shows a website inside the MDT, for example a GitBook, a Google Doc or a Notion page. The URL must start with http:// or https://. |
Each page also has a Title, a Short Description and an Icon.
Who can view a page
Set this under Who can view this page in Page Settings:
- Everyone in the department: every rank can open it.
- A rank and above: for example Sergeant and above.
- No rank access (tags / editors only): only people with one of the page's tags, plus editors.
Tags with access lets anyone holding one of those profile tags (for example SWAT) open the page, whatever their rank. Type a tag and press Enter to add it.
Choosing No rank access and adding no tags makes the page visible to editors only. Use this for drafts.
Pages only show in the department they were created in. Players in another department, or a rank that has no access, never see them.
Navigation bar or Library only
Show in navigation bar pins the page to the MDT sidebar. Turn it off to keep the page in the Page Library only (it shows a Hidden from nav label there).
Editors can change the order of pages with Move earlier / Move later in the Library, and the order of sections inside a document the same way.
Reader and Live Site (External Link pages)
Many websites refuse to be shown inside another page, and FiveM makes this worse. External Link pages therefore have two modes, switched from the toolbar at the top of the page:
- Reader (default): the server downloads the document and the MDT shows it as a clean, searchable page. This works for most documentation sites, including GitBook. Links to other pages on the same site open inside the reader, with a Back button.
- Live Site: the real website. Google Docs, Sheets and Slides, YouTube and Notion load through their official embed links. Other sites load through the MDT server, so they show even if they normally block embedding.
The MDT remembers the chosen mode per website for each player. Open Externally opens the page in the player's browser.
Live Site setup
Live Site needs the public https address of your server. On most servers this is picked up automatically from the web_baseUrl convar. If players see "Live Site needs the server's public https address", set it yourself in shared/server_config.lua:
ServerConfig.LinkProxy = {
BaseUrl = "https://your-server-address"
}Reader mode needs no setup.
For safety, the server will not load addresses on a local or private network (
localhost,192.168.x.x,10.x.x.xand so on).
Database
The mdt_custom_pages and mdt_custom_page_sections tables are created automatically when the resource starts. If your database user cannot create tables, run [SEPARATE SQL]/mdt_custom_pages.sql once.
Troubleshooting
- No Page Library button: the rank is missing Create/Edit Custom Pages. Check it is unlocked for the department in
/mdt-adminand assigned in Department Settings. - A player cannot see a page: check Who can view this page, the player's rank and tags, and that they have the right department selected in the MDT header.
- An External Link page stays blank: switch between Reader and Live Site, or use Open Externally.
- "This section is too long": split the section into smaller ones.