Configuration
Register the manual as a dashboard widget in the
Configuration/Services.yaml of the same sitepackage or extension:
services:
# … your existing services
my_sitepackage.manual:
class: 'ProudNerds\PnBackendManual\Widgets\ManualWidget'
arguments:
$options:
file: 'EXT:my_sitepackage/Resources/Private/Manual/EditorManual.md'
logo: 'EXT:my_sitepackage/Resources/Public/Images/logo.svg'
numbered: true
contentsDepth: 2
printButton: true
tags:
- name: dashboard.widget
identifier: 'mySitepackageManual'
groupNames: 'documentation'
title: 'my_sitepackage.messages:manual.title'
description: 'my_sitepackage.messages:manual.description'
iconIdentifier: 'content-book'
height: 'medium'
width: 'medium'
The service name (my_) can be any unique name. Several
manuals, for example one for editors and one for administrators, are several
services with their own identifier.
Flush the caches (typo3 cache:) after changing Services..
Options
The options are passed as $options to the widget class.
-
- Type
- string
- Required
true
EXT:path of the Markdown file, see Write the Markdown file.
-
- Type
- string
EXT:path of an image inResources/, shown in the widget and the full view. It is shown on a white plate, because most logos are made for a light background and the backend may be dark. Decorative (Public alt=""): the title is next to it. A logo that cannot be found is left out.
-
- Type
- boolean
- Default
- false
truenumbers the chapters (##) as 1., 2. and their sections (###) as 1.1, 1.2, in the headings and in both tables of contents.
-
- Type
- integer
- Default
- 1
The table of contents of the full view:
1shows the chapters,2also their sections, indented under the chapter title, with the chapters in bold. The widget always shows the chapters only, because its height is fixed.
-
- Type
- boolean
- Default
- true
falseremoves the Print or save as PDF button from the full view. See Print or save as PDF.
Widget settings
The tag dashboard. is the core registration of a dashboard widget.
| Setting | Required | Meaning |
|---|---|---|
identifier | yes | Unique widget identifier. This is what you grant to backend groups,
and the manual parameter of the full view. Use a prefix of your
sitepackage or extension. |
group | yes | documentation puts the widget under
Add widget > Documentation, next to the core
documentation widgets. |
title, description | yes | Shown in the widget wizard and as widget title. Plain text or a
label reference (my_ or LLL:). |
icon | no | Icon in the widget wizard; content- fits a manual. |
height, width | no | small, medium or large. Widgets have a fixed height:
choose the smallest one in which the introduction and the table of
contents fit without scrolling. |