Skip to content

Commit 6a9a995

Browse files
authored
[TASK] Move TYPO3 ViewHelper examples into Reference (#100)
Releases: main, 13.4
1 parent af844b0 commit 6a9a995

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2150
-305
lines changed

Documentation/Global/Asset/Css.rst

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php
51
:navigation-title: asset.css
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-asset-css:
105

116
====================================
@@ -14,3 +9,30 @@ Asset.css ViewHelper `<f:asset.css>`
149

1510
.. typo3:viewhelper:: asset.css
1611
:source: ../../Global.json
12+
:display: tags, description, gitHubLink, arguments
13+
14+
.. _typo3-fluid-asset-css-example:
15+
16+
Examples
17+
========
18+
19+
::
20+
21+
<f:asset.css identifier="identifier123" href="EXT:my_ext/Resources/Public/Css/foo.css" />
22+
<f:asset.css identifier="identifier123">
23+
.foo { color: black; }
24+
</f:asset.css>
25+
26+
.. _typo3-fluid-asset-css-details:
27+
28+
Details
29+
=======
30+
31+
In the AssetCollector, the "identifier" attribute is used as a unique identifier. Thus, if assets are added multiple
32+
times using the same identifier, the asset will only be served once (the last added overrides previous assets).
33+
34+
Some available attributes are defaults but do not make sense for this ViewHelper. Relevant attributes specific
35+
for this ViewHelper are: as, crossorigin, disabled, href, hreflang, importance, integrity, media, referrerpolicy,
36+
sizes, type, nonce.
37+
38+
Using the "inline" argument, the file content of the referenced file is added as inline style.
Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Asset/ScriptViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Asset/ScriptViewHelper.php
51
:navigation-title: asset.script
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-asset-script:
105

116
==========================================
@@ -14,3 +9,29 @@ Asset.script ViewHelper `<f:asset.script>`
149

1510
.. typo3:viewhelper:: asset.script
1611
:source: ../../Global.json
12+
:display: tags,description,gitHubLink,arguments
13+
14+
.. _typo3-fluid-asset-script-example:
15+
16+
Examples
17+
========
18+
19+
::
20+
21+
<f:asset.script identifier="identifier123" src="EXT:my_ext/Resources/Public/JavaScript/foo.js" />
22+
<f:asset.script identifier="identifier123">
23+
alert('hello world');
24+
</f:asset.script>
25+
26+
.. _typo3-fluid-asset-script-details:
27+
28+
Details
29+
=======
30+
31+
In the AssetCollector, the "identifier" attribute is used as a unique identifier. Thus, if assets are added multiple
32+
times using the same identifier, the asset will only be served once (the last added overrides previous assets).
33+
34+
Some available attributes are defaults but do not make sense for this ViewHelper. Relevant attributes specific
35+
for this ViewHelper are: async, crossorigin, defer, integrity, nomodule, nonce, referrerpolicy, src, type.
36+
37+
Using the "inline" argument, the file content of the referenced file is added as inline script.
Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/InfoboxViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/InfoboxViewHelper.php
51
:navigation-title: be.infobox
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-be-infobox:
105

116
======================================
@@ -14,3 +9,42 @@ Be.infobox ViewHelper `<f:be.infobox>`
149

1510
.. typo3:viewhelper:: be.infobox
1611
:source: ../../Global.json
12+
:display: tags,description,gitHubLink,arguments
13+
14+
.. _typo3-fluid-be-infobox-states:
15+
16+
States
17+
======
18+
19+
The Infobox provides different context-sensitive states that
20+
can be used to provide an additional visual feedback to the
21+
22+
user to underline the meaning of the information.
23+
24+
Possible values are in range from ``-2`` to ``2``. Please choose a
25+
meaningful value from the following list.
26+
27+
``-2``
28+
Notices (Default)
29+
``-1``
30+
Information
31+
``0``
32+
Positive feedback
33+
``1``
34+
Warnings
35+
``2``
36+
Error
37+
38+
.. _typo3-fluid-be-infobox-example:
39+
40+
Examples
41+
========
42+
43+
Simple::
44+
45+
<f:be.infobox title="Message title">your box content</f:be.infobox>
46+
47+
All options::
48+
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" />
50+

Documentation/Global/Be/Link.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/LinkViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/LinkViewHelper.php
51
:navigation-title: be.link
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-be-link:
105

116
================================
@@ -14,3 +9,15 @@ Be.link ViewHelper `<f:be.link>`
149

1510
.. typo3:viewhelper:: be.link
1611
:source: ../../Global.json
12+
:display: tags,description,gitHubLink,arguments
13+
14+
.. _typo3-fluid-be-link-example:
15+
16+
Examples
17+
========
18+
19+
URI to the web_ts module on page 92::
20+
21+
<f:be.link route="web_ts" parameters="{id: 92}">Go to web_ts</f:be.link>
22+
23+
``<a href="/typo3/module/web/ts?token=b6e9c9f&id=92">Go to web_ts</a>``
Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuViewHelper.php
51
:navigation-title: be.menus.actionMenu
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-be-menus-actionmenu:
105

116
========================================================
@@ -14,3 +9,28 @@ Be.menus.actionMenu ViewHelper `<f:be.menus.actionMenu>`
149

1510
.. typo3:viewhelper:: be.menus.actionMenu
1611
:source: ../../../Global.json
12+
:display: tags,description,gitHubLink,arguments
13+
14+
.. _typo3-fluid-be-menus-actionmenu-example:
15+
16+
Examples
17+
========
18+
19+
Simple::
20+
21+
<f:be.menus.actionMenu>
22+
<f:be.menus.actionMenuItem label="Overview" controller="Blog" action="index" />
23+
<f:be.menus.actionMenuItem label="Create new Blog" controller="Blog" action="new" />
24+
<f:be.menus.actionMenuItem label="List Posts" controller="Post" action="index" arguments="{blog: blog}" />
25+
</f:be.menus.actionMenu>
26+
27+
Select box with the options "Overview", "Create new Blog" and "List Posts".
28+
29+
Localized::
30+
31+
<f:be.menus.actionMenu>
32+
<f:be.menus.actionMenuItem label="{f:translate(key:'overview')}" controller="Blog" action="index" />
33+
<f:be.menus.actionMenuItem label="{f:translate(key:'create_blog')}" controller="Blog" action="new" />
34+
</f:be.menus.actionMenu>
35+
36+
Localized select box.
Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuItemViewHelper.php
51
:navigation-title: be.menus.actionMenuItem
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-be-menus-actionmenuitem:
105

116
================================================================
@@ -14,3 +9,28 @@ Be.menus.actionMenuItem ViewHelper `<f:be.menus.actionMenuItem>`
149

1510
.. typo3:viewhelper:: be.menus.actionMenuItem
1611
:source: ../../../Global.json
12+
:display: tags,description,gitHubLink,arguments
13+
14+
.. _typo3-fluid-be-menus-actionmenuitem-example:
15+
16+
Examples
17+
========
18+
19+
Simple::
20+
21+
<f:be.menus.actionMenu>
22+
<f:be.menus.actionMenuItem label="Overview" controller="Blog" action="index" />
23+
<f:be.menus.actionMenuItem label="Create new Blog" controller="Blog" action="new" />
24+
<f:be.menus.actionMenuItem label="List Posts" controller="Post" action="index" arguments="{blog: blog}" />
25+
</f:be.menus.actionMenu>
26+
27+
Select box with the options "Overview", "Create new Blog" and "List Posts".
28+
29+
Localized::
30+
31+
<f:be.menus.actionMenu>
32+
<f:be.menus.actionMenuItem label="{f:translate(key='overview')}" controller="Blog" action="index" />
33+
<f:be.menus.actionMenuItem label="{f:translate(key='create_blog')}" controller="Blog" action="new" />
34+
</f:be.menus.actionMenu>
35+
36+
Localized select box.

Documentation/Global/Be/Menus/ActionMenuItemGroup.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,24 @@ Be.menus.actionMenuItemGroup ViewHelper `<f:be.menus.actionMenuItemGroup>`
1414

1515
.. typo3:viewhelper:: be.menus.actionMenuItemGroup
1616
:source: ../../../Global.json
17+
:display: tags,description,gitHubLink,arguments
18+
19+
.. _typo3-fluid-be-menus-actionmenuitemgroup-example:
20+
21+
Example
22+
=======
23+
24+
::
25+
26+
<f:be.menus.actionMenu>
27+
<f:be.menus.actionMenuItem label="Default: Welcome" controller="Default" action="index" />
28+
<f:be.menus.actionMenuItem label="Community: get in touch" controller="Community" action="index" />
29+
30+
<f:be.menus.actionMenuItemGroup label="Information">
31+
<f:be.menus.actionMenuItem label="PHP Information" controller="Information" action="listPhpInfo" />
32+
<f:be.menus.actionMenuItem label="Documentation" controller="Information" action="documentation" />
33+
<f:be.menus.actionMenuItem label="Hooks" controller="Information" action="hooks" />
34+
<f:be.menus.actionMenuItem label="Signals" controller="Information" action="signals" />
35+
<f:be.menus.actionMenuItem label="XClasses" controller="Information" action="xclass" />
36+
</f:be.menus.actionMenuItemGroup>
37+
</f:be.menus.actionMenu>
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php
51
:navigation-title: be.pageInfo
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-be-pageinfo:
105

116
========================================
@@ -14,3 +9,15 @@ Be.pageInfo ViewHelper `<f:be.pageInfo>`
149

1510
.. typo3:viewhelper:: be.pageInfo
1611
:source: ../../Global.json
12+
:display: tags,description,gitHubLink,arguments
13+
14+
.. _typo3-fluid-be-pageinfo-example:
15+
16+
Examples
17+
========
18+
19+
Default::
20+
21+
<f:be.pageInfo />
22+
23+
Page info icon with context menu
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/PagePathViewHelper.php
51
:navigation-title: be.pagePath
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-be-pagepath:
105

116
========================================
@@ -14,3 +9,16 @@ Be.pagePath ViewHelper `<f:be.pagePath>`
149

1510
.. typo3:viewhelper:: be.pagePath
1611
:source: ../../Global.json
12+
:display: tags,description,gitHubLink,arguments
13+
14+
.. _typo3-fluid-be-pagepath-example:
15+
16+
Examples
17+
========
18+
19+
Default::
20+
21+
<f:be.pagePath />
22+
23+
Current page path, prefixed with "Path:" and wrapped in a span with the class ``typo3-docheader-pagePath``.
24+
Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.. This reStructured text file has been automatically generated, do not change.
2-
.. Source: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageRendererViewHelper.php
3-
4-
:edit-on-github-link: https://github.com/TYPO3/typo3/edit/main/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageRendererViewHelper.php
51
:navigation-title: be.pageRenderer
62

73
.. include:: /Includes.rst.txt
8-
94
.. _typo3-fluid-be-pagerenderer:
105

116
================================================
@@ -14,3 +9,23 @@ Be.pageRenderer ViewHelper `<f:be.pageRenderer>`
149

1510
.. typo3:viewhelper:: be.pageRenderer
1611
:source: ../../Global.json
12+
:display: tags,description,gitHubLink,arguments
13+
14+
.. _typo3-fluid-be-pagerenderer-example:
15+
16+
Examples
17+
========
18+
19+
All options::
20+
21+
<f:be.pageRenderer
22+
pageTitle="foo"
23+
includeCssFiles="{0: 'EXT:my_ext/Resources/Public/Css/Stylesheet.css'}"
24+
includeJsFiles="{0: 'EXT:my_ext/Resources/Public/JavaScript/Library1.js', 1: 'EXT:my_ext/Resources/Public/JavaScript/Library2.js'}"
25+
addJsInlineLabels="{'my_ext.label1': 'LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:label1'}"
26+
includeJavaScriptModules="{0: '@my-vendor/my-ext/my-module.js'}"
27+
addInlineSettings="{'some.setting.key': 'some.setting.value'}"
28+
/>
29+
30+
This will load the specified css, js files and JavaScript modules, adds a custom js
31+
inline setting, and adds a resolved label to be used in js.

0 commit comments

Comments
 (0)