You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/templating/components.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,9 @@ You can create a Twig Component and add it to a group using YAML configuration,
41
41
42
42
``` yaml
43
43
ibexa_twig_components:
44
+
# Component group
44
45
storefront-before-head:
46
+
# Component name
45
47
google_tag_manager:
46
48
type: script
47
49
arguments:
@@ -50,15 +52,15 @@ ibexa_twig_components:
50
52
51
53
The Component priority cannot be specified when using the YAML configuration, but it allows you to use the built-in components to quickly achieve common goals.
52
54
53
-
## Built-in componenents
55
+
## Built-in components
54
56
55
57
| Name | Description | YAML type |
56
58
|---|---|---|
57
-
| Script | Renders a [`<script>` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script) | `script` |
58
-
| Stylesheet | Renders a [`<link>` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) | `stylesheet`
59
-
| Template | Renders a Twig template|`template` |
60
-
| Controller | Renders a Symfony controller |`controller` |
61
-
| HTML | Renders static HTML |`html` |
59
+
| [Script](https://github.com/ibexa/twig-components/blob/main/src/lib/Component/ScriptComponent.php) | Renders a [`<script>` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script) | `script` |
60
+
| [Stylesheet](https://github.com/ibexa/twig-components/blob/main/src/lib/Component/LinkComponent.php) | Renders a [`<link>` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) | `stylesheet`
61
+
| [Template](https://github.com/ibexa/twig-components/blob/main/src/lib/Component/TemplateComponent.php) | Renders a Twig template|`template` |
62
+
| [Controller](https://github.com/ibexa/twig-components/blob/main/src/lib/Component/ControllerComponent.php) | Renders a Symfony controller |`controller` |
63
+
| [HTML](https://github.com/ibexa/twig-components/blob/main/src/lib/Component/HtmlComponent.php) | Renders static HTML |`html` |
62
64
63
65
See the example below:
64
66
``` yaml
@@ -117,7 +119,7 @@ You can modify the Component rendering process by:
117
119
118
120
Use the built-in integration with [Symfony Profiler]([[= symfony_doc =]]/profiler.html) to see which Twig Components have been rendered in a given view. In the [[= product_name =]] tab you can find:
119
121
120
-
- the list of rendered Twig Component groups
121
-
- the list of rendered Twig Components
122
+
- the list of all rendered Twig Component groups by the given view, including empty groups
123
+
- the list of rendered Twig Components with information about the group they belong to
122
124
123
125

0 commit comments