Interfaces

The following list provides information for all necessary interfaces that are used inside of this documentation. For up to date information, please check the source code.

class TYPO3\CMS\Dashboard\Widgets\WidgetInterface

Has to be implemented by all widgets. This interface defines public API used by ext:dashboard to interact with widgets.

renderWidgetContent()
Return type:string
Returns:The rendered HTML to display.
getOptions()
Return type:array
Returns:The options of the widget as set in the registration.
class TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface

Used internally in ext:dashboard. Used to separate internal configuration from widgets. Can be required in widget classes and passed to view.

getIdentifier()
Return type:string
Returns:Unique identifer of a widget.
getServiceName()
Return type:string
Returns:Service name providing the widget implementation.
getGroupNames()
Return type:array
Returns:Group names associated to this widget.
getTitle()
Return type:string
Returns:Title of a widget, this is used for the widget selector.
getDescription()
Return type:string
Returns:Description of a widget, this is used for the widget selector.
getIconIdentifier()
Return type:string
Returns:Icon identifier of a widget, this is used for the widget selector.
getHeight()
Return type:int
Returns:Height of a widget in rows (1-6).
getWidth()
Return type:int
Returns:Width of a widget in columns (1-4).
getAdditionalCssClasses()
Return type:array
Returns:Additional CSS classes which should be added to the rendered widget.
class TYPO3\CMS\Dashboard\Widgets\RequireJsModuleInterface

Widgets implementing this interface will add the provided RequireJS modules. Those modules will be loaded in dashboard view if the widget is added at least once.

getRequireJsModules()

Returns a list of RequireJS modules that should be loaded, e.g.:

return [
    'TYPO3/CMS/MyExtension/ModuleName',
    'TYPO3/CMS/MyExtension/Module2Name',
];

See also RequireJS in the TYPO3 Backend for further information regarding RequireJS in TYPO3 Backend.

Return type:array
Returns:List of modules to require.
class TYPO3\CMS\Dashboard\Widgets\AdditionalJavaScriptInterface

Widgets implementing this interface will add the provided JavaScript files. Those files will be loaded in dashboard view if the widget is added at least once.

getJsFiles()

Returns a list of JavaScript file names that should be included, e.g.:

return [
    'EXT:my_extension/Resources/Public/JavaScript/file.js',
    'EXT:my_extension/Resources/Public/JavaScript/file2.js',
];
Return type:array
Returns:List of JS files to load.
class TYPO3\CMS\Dashboard\Widgets\AdditionalCssInterface

Widgets implementing this interface will add the provided Css files. Those files will be loaded in dashboard view if the widget is added at least once.

getCssFiles()

Returns a list of Css file names that should be included, e.g.:

return [
    'EXT:my_extension/Resources/Public/Css/widgets.css',
    'EXT:my_extension/Resources/Public/Css/list-widget.css',
];
Return type:array
Returns:List of Css files to load.
class TYPO3\CMS\Dashboard\Widgets\ButtonProviderInterface
getTitle()
Return type:string
Returns:The title used for the button. E.g. an LLL:EXT: reference like LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.t3news.moreItems.
Return type:string
Returns:The link to use for the button. Clicking the button will open the link.
getTarget()
Return type:string
Returns:The target of the link, e.g. _blank. LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.t3news.moreItems.
class TYPO3\CMS\Dashboard\Widgets\NumberWithIconDataProviderInterface
getNumber()
Return type:integer
Returns:The number to display for an number widget.
class TYPO3\CMS\Dashboard\Widgets\EventDataInterface
getEventData()
Return type:array
Returns:Returns data which should be send to the widget as JSON encoded value.
class TYPO3\CMS\Dashboard\Widgets\ChartDataProviderInterface
getChartData()
Return type:array
Returns:Provide the data for a graph. The data and options you have depend on the type of chart. More information can be found in the documentation of the specific type:
Bar
https://www.chartjs.org/docs/latest/charts/bar.html#data-structure
Doughnut
https://www.chartjs.org/docs/latest/charts/doughnut.html#data-structure
class TYPO3\CMS\Dashboard\Widgets\ListDataProviderInterface
getItems()
Return type:array
Returns:Provide the array if items. Each entry should be a single string.