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
description: Customize product tour scenarios by creating custom step blocks
10
-
edition: lts-update
11
-
month_change: false
12
-
---
13
-
14
-
# Create custom step blocks
15
-
16
-
TODO: This is not possible
17
-
18
-
When creating [product tour scenarios](integrated_help.md#product-tours) you're not limited to the [built-in step blocks](configure_product_tour.md#block-types).
19
-
You can create custom block types, allowing you create reusable blocks that can be shared between scenarios.
20
-
21
-
It's a more customizable alternative the [custom Twig block](configure_product_tour.md#custom-twig-template-block), as you can pass custom variables and add additional logic before rendering the template.
22
-
23
-
The following example creates a custom `tip` block, a reusable component that you can use in different steps to provide tips to the user.
24
-
25
-
To create a custom step block, start by creating a class implementing the `Ibexa\Contracts\IntegratedHelp\Builder\Block\BlockBuilderInterface` interface.
26
-
This class is responsbile for converting the YAML configuration into PHP objects.
27
-
28
-
``` php
29
-
```
30
-
31
-
Register it as a Symfony service and use the `ibexa.product_tour.block_factory` service tag to register is as a custom block configuration option:
32
-
33
-
``` yaml
34
-
```
35
-
36
-
Then, create a class responsible for rendering the block:
37
-
38
-
``` php
39
-
```
40
-
41
-
Register it as a Symfony service and use the `ibexa.product_tour.block_renderer` service tag to mark the class as a custom block renderer.
42
-
43
-
``` yaml
44
-
45
-
```
4
+
3) Screenshoty
5
+
4) Przekazywanie danych do tagu typu video - czy tylko url?
Copy file name to clipboardExpand all lines: docs/administration/back_office/configure_product_tour.md
+41-22Lines changed: 41 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ You can configure the product tour scenarios to adapt it to your project needs,
11
11
Product tour scenarios are configured using YAML configuration files.
12
12
Configuration is SiteAccess-aware, allowing you to create separate onboarding experiences for different back offices in [multisite setups](multisite.md).
13
13
14
-
For more advanced customization cases that require PHP code, see the [integrated help's `RenderProductTourScenarioEvent`](integrated_help_events.md).
14
+
For more advanced customization cases that require PHP code, see [Customize product tour](customize_product_tour.md).
15
15
16
16
Use the default provided configuration, available in `config/packages/ibexa_integrated_help_tours.yaml`, as a starting point that you can adjust to your needs.
<step_identifier>: # Scenario step, unique within a scenario
35
35
step_title_translation_key: <translation_key>
36
36
background_image: <image_path> # Only for general type, optional
37
37
target: <css_selector> # Only for targetable type, required
@@ -60,6 +60,8 @@ tour.list.item2: "Second item"
60
60
tour.list.item3: "Third item"
61
61
```
62
62
63
+
To insert a line break into a translation, HTML encode the `<br>` entities to `<br/>`.
64
+
63
65
## Scenario configuration
64
66
65
67
Each scenario must specify its type and can optionally restrict access by user groups.
@@ -68,7 +70,7 @@ Each scenario must specify its type and can optionally restrict access by user g
68
70
69
71
The order of scenarios in the configuration file determines the order in which they are evaluated and, if the right conditions are met, displayed.
70
72
71
-
For **general scenario**, the scenario appears at the earliest opportunity (on any page after logging in).
73
+
For **general scenario**, the scenario appears at the earliest opportunity (on any page after logging in), with an exception of the user settings area.
72
74
73
75
For **targeted scenarios**, the scenario begins if the target element is found in the DOM.
74
76
This means the scenario only appears on pages where the target element exists.
@@ -88,17 +90,22 @@ product_tour:
88
90
89
91
### User group restrictions
90
92
91
-
Restrict tour visibility by excluding specific user groups by using their content remote IDs:
93
+
Restrict scenario visibility by excluding specific user groups by using their content remote IDs:
92
94
93
95
```yaml
94
96
product_tour:
95
-
my_tour:
97
+
my_scenario:
96
98
user_groups_excluded: ['user_group_content_remote_id_1', 'user_group_content_remote_id_2'] # Exclude specific user groups
97
99
```
98
100
99
101
When creating new [back office user groups](user_registration.md#user-types), you should decide whether the existing product tour scenarios should be available for the new user group.
100
102
If not, add the new group to the exclusion list.
101
103
104
+
!!! warning
105
+
106
+
If a scenario contains information meant only for specific group of users, always use the `user_groups_excluded` setting to exclude other groups.
107
+
Don't rely only on UI access restrictions to control the access to scenarios, as a malicious internal user could trigger and preview them outside of the intended place.
108
+
102
109
## Step configuration
103
110
104
111
Steps define individual instructions within a scenario.
@@ -123,6 +130,7 @@ You can select a specific element by using the `target` setting.
123
130
124
131
If a step's target element doesn't exist on the page, the step isn't be displayed and the scenario is be stopped.
125
132
Ensure your configuration matches the actual DOM structure to avoid broken scenarios.
133
+
Use unique selectors to avoid triggering your scenarios on other pages.
126
134
127
135
#### Interaction modes
128
136
@@ -131,6 +139,12 @@ Targeted steps support [three interaction modes](product_tour.md#targeted-scenar
131
139
132
140
TODO: 2 pane screenshot here, showing the UI for each of types.
133
141
142
+
!!! note
143
+
144
+
Clickable and draggable modes are designed for single actions only (buttons, links).
145
+
You can't select an entire form.
146
+
If the interaction with the highlighted element results in redirection to a new page or opening a modal window where the previous target element can't be found, the "Previous" navigation step will be disabled.
147
+
134
148
**Standard mode**:
135
149
136
150
The default value. A tooltip attached to specific element on the page is displayed.
@@ -149,12 +163,6 @@ Users continue the scenario by clicking the highlighted element.
Clickable mode is designed for single actions only (buttons, links).
155
-
You can't select an entire form.
156
-
If the interaction with the highlighted element results in redirection to a new page or opening a modal window where the previous target element can't be found, the "Previous" navigation step will be disabled.
157
-
158
166
**Draggable mode**:
159
167
160
168
A tooltip attached to specific element on the page is displayed.
@@ -168,6 +176,7 @@ Users continue the scenario by [dragging](https://developer.mozilla.org/en-US/do
168
176
169
177
Blocks are content elements that make up each step, available both for `general` and `targetable` scenarios.
170
178
Seven block types are available for building step content, and a scenario step must contain at least one.
179
+
If multiple blocks are defined for a step, they are displayed one after the other.
171
180
172
181
TODO: Step screenshot with all 7 blocks available?
173
182
@@ -195,32 +204,40 @@ Add external or internal links:
Embed video content by using the [`video` HTML element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/video):
217
+
### Media blocks
218
+
219
+
To provide data to the media block, place your image or video files in the `public` directory and provide the relative path to it.
220
+
221
+
!!! tip
222
+
223
+
To resolve the path relative to the site root, [prefix it with `/`](https://developer.mozilla.org/en-US/docs/Web/API/URL_API/Resolving_relative_references#root_relative).
TODO: Move to "Customize product tour?" Maybe it's a better place
21
-
22
-
This event is dispatched before rendering a product tour scenario and you can use it to:
23
-
24
-
- Modify tour steps based on user permissions or roles
25
-
- Add or remove steps dynamically
26
-
- Change block content based on runtime conditions
27
-
- Integrate custom data into tour scenarios
28
-
29
-
With the following example, the scenario is modified to trigger only when certain conditions are matched. When the current user has a pending [notification]([[= user_doc =]]/getting_started/notifications/), a custom onboarding scenario is triggered.
30
-
31
-
First, define a custom product tour scenario.
32
-
It contains a placeholder step with a single block.
33
-
34
-
```yaml
35
-
ibexa:
36
-
system:
37
-
default:
38
-
product_tour:
39
-
notifications:
40
-
type: 'targetable'
41
-
steps:
42
-
placeholder_step:
43
-
step_title_translation_key: 'This is a placeholder step'
0 commit comments