Skip to content

Commit 7bd60d1

Browse files
authored
[TASK] Improve BE Infobox ViewHelper page (#104)
Releases: main, 13.4
1 parent 6e7c25d commit 7bd60d1

File tree

7 files changed

+208
-29
lines changed

7 files changed

+208
-29
lines changed

.editorconfig

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,68 @@
1-
# EditorConfig is awesome: https://EditorConfig.org
2-
#
3-
# Use as master: https://github.com/TYPO3-Documentation/T3DocTeam/blob/main/.editorconfig
1+
# EditorConfig is awesome: http://EditorConfig.org
42

53
# top-most EditorConfig file
64
root = true
75

8-
[{*.rst,*.rst.txt}]
6+
# Unix-style newlines with a newline ending every file
7+
[*]
98
charset = utf-8
109
end_of_line = lf
10+
indent_style = space
11+
indent_size = 4
1112
insert_final_newline = true
1213
trim_trailing_whitespace = true
13-
indent_style = space
14+
15+
# TS/JS-Files
16+
[*.{ts,js,mjs}]
17+
indent_size = 2
18+
19+
# JSON-Files
20+
[*.json]
21+
indent_style = tab
22+
23+
# ReST-Files
24+
[*.{rst,rst.txt}]
1425
indent_size = 4
1526
max_line_length = 80
1627

17-
# MD-Files
28+
# Markdown-Files
1829
[*.md]
19-
charset = utf-8
20-
end_of_line = lf
21-
insert_final_newline = true
22-
trim_trailing_whitespace = true
23-
indent_style = space
24-
indent_size = 4
2530
max_line_length = 80
2631

32+
# YAML-Files
33+
[*.{yaml,yml}]
34+
indent_size = 2
35+
36+
# NEON-Files
37+
[*.neon]
38+
indent_size = 2
39+
indent_style = tab
40+
41+
# stylelint
42+
[.stylelintrc]
43+
indent_size = 2
44+
45+
# package.json
46+
[package.json]
47+
indent_size = 2
48+
49+
# TypoScript
50+
[*.{typoscript,tsconfig}]
51+
indent_size = 2
52+
53+
# XLF-Files
54+
[*.xlf]
55+
indent_style = tab
56+
57+
# SQL-Files
58+
[*.sql]
59+
indent_style = tab
60+
indent_size = 2
61+
62+
# .htaccess
63+
[{_.htaccess,.htaccess}]
64+
indent_style = tab
65+
2766
[Makefile]
2867
# Use tabs for indentation (Makefiles require tabs)
2968
indent_style = tab

Documentation/Global/Be/Infobox.rst

Lines changed: 89 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@
77
Be.infobox ViewHelper `<f:be.infobox>`
88
======================================
99

10+
.. figure:: /Images/BeInfoboxWithHTML.png
11+
:alt: A screenshot demonstrating a complex infobox with HTML content
12+
13+
See example `Infobox with HTML content, icon and links <https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-be-infobox-example-html>`_
14+
1015
.. typo3:viewhelper:: be.infobox
1116
:source: ../../Global.json
12-
:display: tags,description,gitHubLink,arguments
17+
:display: tags,description,gitHubLink
18+
:noindex:
19+
20+
.. contents:: Table of contents
1321

1422
.. _typo3-fluid-be-infobox-states:
1523

16-
States
17-
======
24+
Severity states of the Be.infobox ViewHelper
25+
============================================
1826

1927
The Infobox provides different context-sensitive states that
2028
can be used to provide an additional visual feedback to the
@@ -24,27 +32,91 @@ user to underline the meaning of the information.
2432
Possible values are in range from ``-2`` to ``2``. Please choose a
2533
meaningful value from the following list.
2634

27-
``-2``
28-
Notices (Default)
29-
``-1``
30-
Information
31-
``0``
32-
Positive feedback
33-
``1``
34-
Warnings
35-
``2``
36-
Error
35+
.. tabs::
36+
37+
.. group-tab:: Screenshot
38+
39+
.. figure:: /Images/BeInfobox.png
40+
:alt: A screenshot demonstrating all possible infobox colors and states.
41+
42+
A demonstration of all possible states
43+
44+
.. group-tab:: Numeral values
45+
46+
``-2``
47+
Notices (Default)
48+
``-1``
49+
Information
50+
``0``
51+
Positive feedback
52+
``1``
53+
Warnings
54+
``2``
55+
Error
56+
57+
.. group-tab:: Code example
58+
59+
It is considered best practice to use the states from
60+
:php:`\TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper` together with the
61+
`Constant ViewHelper <f:constant> <https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-constant>`_:
62+
63+
.. literalinclude:: _Infobox/_States.html
64+
:caption: EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
3765

3866
.. _typo3-fluid-be-infobox-example:
3967

4068
Examples
4169
========
4270

43-
Simple::
71+
Info box of level notice with a static title and a static text:
72+
73+
.. code-block:: html
74+
:caption: EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
75+
76+
<f:be.infobox title="Message title">your box content</f:be.infobox>
4477

45-
<f:be.infobox title="Message title">your box content</f:be.infobox>
78+
Warning box with disabled icon:
4679

47-
All options::
80+
.. code-block:: html
81+
:caption: EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
4882

49-
<f:be.infobox title="Message title" message="your box content" state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_NOTICE')}" iconName="check" disableIcon="true" />
83+
<f:be.infobox
84+
title="Message title"
85+
message="your box content"
86+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_WARNING')}"
87+
disableIcon="true"
88+
/>
5089

90+
Success box with custom icon:
91+
92+
.. code-block:: html
93+
:caption: EXT:my_extension/Resources/Private/Backend/Templates/MyModule.html
94+
95+
<f:be.infobox
96+
title="Message title"
97+
message="your box content"
98+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_OK')}"
99+
iconName="check"
100+
/>
101+
102+
103+
.. _typo3-fluid-be-infobox-example-html:
104+
105+
Infobox with HTML content, icon and links
106+
-----------------------------------------
107+
108+
You can find this example in the TYPO3 backend module
109+
:guilabel:`System > DB Check > Manage Reference Index` if
110+
:composer:`typo3/cms-lowlevel` is installed.
111+
112+
.. literalinclude:: _Infobox/_ReferenceIndex.html
113+
:caption: EXT:lowlevel/Resources/Private/Templates/ReferenceIndex.html
114+
115+
.. _typo3-fluid-be-infobox-arguments:
116+
117+
Arguments
118+
=========
119+
120+
.. typo3:viewhelper:: be.infobox
121+
:source: ../../Global.json
122+
:display: arguments-only
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<f:be.infobox
2+
title="{f:translate(key:'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:checkScript_headline')}"
3+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_INFO')}"
4+
>
5+
<p>{f:translate(key:'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:checkScript')}</p>
6+
<p>
7+
{f:translate(key:'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:checkScript_check_description')}<br>
8+
<code>php {binaryPath} referenceindex:update -c</code>
9+
</p>
10+
<p>
11+
{f:translate(key:'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:checkScript_update_description')}<br>
12+
<code>php {binaryPath} referenceindex:update</code>
13+
</p>
14+
<p>
15+
{f:translate(key:'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:checkScript_moreDetails')}
16+
<a href="{ReadmeLink}" target="_blank">{ReadmeLocation}</a>
17+
</p>
18+
</f:be.infobox>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<f:be.infobox
2+
title="Some Info"
3+
message="The message"
4+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_NOTICE')}"
5+
/>
6+
<f:be.infobox
7+
title="Some Notice"
8+
message="The message"
9+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_INFO')}"
10+
/>
11+
<f:be.infobox
12+
title="Some sucess message"
13+
message="The message"
14+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_OK')}"
15+
/>
16+
<f:be.infobox
17+
title="Some Warning"
18+
message="The message"
19+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_WARNING')}"
20+
/>
21+
<f:be.infobox
22+
title="Some Error"
23+
message="The message"
24+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_ERROR')}"
25+
/>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<f:be.infobox
2+
title="Some Info"
3+
message="The message"
4+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_NOTICE')}"
5+
/>
6+
<f:be.infobox
7+
title="Some Notice"
8+
message="The message"
9+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_INFO')}"
10+
/>
11+
<f:be.infobox
12+
title="Some sucess message"
13+
message="The message"
14+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_OK')}"
15+
/>
16+
<f:be.infobox
17+
title="Some Warning"
18+
message="The message"
19+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_WARNING')}"
20+
/>
21+
<f:be.infobox
22+
title="Some Error"
23+
message="The message"
24+
state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_ERROR')}"
25+
/>

Documentation/Images/BeInfobox.png

12.9 KB
Loading
14.9 KB
Loading

0 commit comments

Comments
 (0)