This guide will show you how to add your own custom TMDB layout to the Cockpit Panel so it can be selected from any module that uses the TMDB WebView system.
Prerequisites
- Access to
panel_info.jsonon your panel in /panel/webview/ - Basic knowledge of PHP, HTML, and CSS
- MT Manager or editor for modifying files
Steps
1. Create Your Custom Layout File
- Inside
/webview/tmdb/, create a new file for your layout. For example:
/webview/tmdb/layout_23.php
- This script must be self-contained—include all PHP, CSS, and JS in a single file.
- This is necessary because WebViews in Cockpit load one file only without referencing other assets.
2. Register the Layout in panel_info.json
- Open
panel/webview/panel_info.json. - Find the section titled "The Movie Database".
- Add your layout to the
"option"array like this:
{ "value": "tmdb_layout_23", "inner": "TMDB: Layout 23", "query": "layout=layout_23" }
- Ensure your value is unique (
tmdb_layout_23in this case).
3. Reload the Panel
- Save your changes and refresh the Cockpit Panel.
- The new layout will now be available in the dropdown for any TMDB-enabled module.
4. Test the Layout
- Select "TMDB: Layout 23" in the WebView settings of a module.
- Ensure the content loads and works correctly.
Important Notes
- This method works as a temporary workaround until user-content bridges are fully implemented in Cockpit Panel.
- All styling, layout, and scripts must be included inline in your single file—no includes or external references.
That’s it! Your custom TMDB layout is now selectable and functional inside your Cockpit Panel.