Skip to content
Snippets Groups Projects
Commit 65fc7df8 authored by Christian Reifenscheid's avatar Christian Reifenscheid Committed by Stefan Bürk
Browse files

[DOCS] Add details about how to extend the admin panel

This commits adds the following hints:
* module classes needs to be set to public
* module classes needs to implement the ShortInfoProviderInterface
* description on how to add custom page settings
* description on how to add custom module settings

Resolves: #104242
Releases: main, 12.4
Change-Id: Id495359e007bf09e38a80bc1097c95946f964217
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84962


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
parent 00701985
Branches
Tags
No related merge requests found
......@@ -26,7 +26,7 @@ To create your own Admin Panel module
=====================================
#. Create a new PHP class extending
`\TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule`.
`\TYPO3\CMS\Adminpanel\ModuleApi\AbstractModule` and implementing `TYPO3\CMS\Adminpanel\ModuleApi\ShortInfoProviderInterface`. If you don't implement the `ShortInfoProviderInterface`, your module will not be shown in the module menu.
#. Implement at least the following methods:
......@@ -39,7 +39,8 @@ To create your own Admin Panel module
* `getShortInfo` - Displayed next to the module label, may contain
aggregated infos (such as `Total Parse Time: 200ms`)
#. Register your module by adding the following in your `ext_localconf.php`
#. Register your module by adding the following in your `ext_localconf.php`. Using `before` or `after` you can influence where your module will be
displayed in the module menu by referencing the identifier / array key of other modules.
.. code-block:: php
......@@ -48,9 +49,7 @@ To create your own Admin Panel module
'before' => ['cache'],
];
Using `before` or `after` you can influence where your module will be
displayed in the module menu by referencing the identifier / array key of
other modules.
#. Ensure that your module class is defined as 'public' in the `Services.yaml` file.
Modules themselves do provide settings for the page rendering and global
actions (like preview settings, clearing caches or adding action buttons for
......@@ -59,9 +58,39 @@ editing the page) but do not provide further content.
If you want to display additional content in the Admin Panel (like rendering
times or backtraces), you have to add a submodule to your main module.
To provide settings in a module, implement the method `getSettings`, which has
to return rendered HTML form elements (but without the form tag), ready to be
used in the Admin Panel main form.
Adding settings
===============
Page settings
-------------
Page settings, like "Preview" or "Cache", are accessible via the "Settings" section in the module menu.
To provide custom page settings, your main module needs to implement the `\TYPO3\CMS\Adminpanel\ModuleApi\PageSettingsProviderInterface` interface.
The corresponding method `getPageSettings()` returns rendered HTML form elements (but without the form tag).
Examples
~~~~~~~~
* `\TYPO3\CMS\Adminpanel\Modules\CacheModule`
* `\TYPO3\CMS\Adminpanel\Modules\PreviewModule`
Module settings
---------------
Module settings are accessible via the cogwheel-button in the opened module.
To provide settings, your submodule needs to implement the `\TYPO3\CMS\Adminpanel\ModuleApi\ModuleSettingsProviderInterface` interface.
The respective method `getSettings()` returns rendered HTML form elements (but without the form tag).
Examples
~~~~~~~~
* `\TYPO3\CMS\Adminpanel\Modules\Debug\Log`
* `\TYPO3\CMS\Adminpanel\Modules\TsDebug\TypoScriptWaterfall`
Adding a sub-module
===================
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment