Skip to content

Commit 549e986

Browse files
authored
Merge branch '5.x' into protip
2 parents 250f28e + f448d3e commit 549e986

File tree

22 files changed

+2041
-48
lines changed

22 files changed

+2041
-48
lines changed

.all-contributorsrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@
4141
"contributions": [
4242
"doc"
4343
]
44+
},
45+
{
46+
"login": "sumbria",
47+
"name": "Balbinder Sumbria",
48+
"avatar_url": "https://avatars.githubusercontent.com/u/6416992?v=4",
49+
"profile": "https://incodit.com",
50+
"contributions": [
51+
"doc"
52+
]
53+
},
54+
{
55+
"login": "Hugo-Prossaird",
56+
"name": "Hugo-Prossaird",
57+
"avatar_url": "https://avatars.githubusercontent.com/u/176997845?v=4",
58+
"profile": "https://github.com/Hugo-Prossaird",
59+
"contributions": [
60+
"doc"
61+
]
4462
}
4563
],
4664
"contributorsPerLine": 7,

.github/styles/config/vocabularies/Mautic/accept.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ AJAX
22
allowlist
33
Amazon SES
44
Ameling
5+
ascenders
56
autoloader
67
Autoloader
78
autowire
@@ -25,6 +26,7 @@ CloudAMQP
2526
Codeception
2627
Codecov
2728
Company(ies)
29+
Composability
2830
Composer
2931
Config
3032
config
@@ -48,8 +50,6 @@ Firewalls
4850
firewalls
4951
Focus Item
5052
Focus Items
51-
Forms
52-
forms
5353
Froala
5454
Froogaloop
5555
gcm
@@ -71,6 +71,8 @@ HubSpot
7171
IDP
7272
IMAP
7373
infographics
74+
Initialisms
75+
initialisms
7476
ISO
7577
JavaScript
7678
Joomla
@@ -140,7 +142,6 @@ Themes
140142
timeframe
141143
Todo
142144
tooltip
143-
Tooltip
144145
Transifex
145146
Translator
146147
TRUE

.gitpod.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ vscode:
1111
- [email protected] # See https://github.com/mautic/user-documentation/pull/334#issuecomment-2405922370 before upgrading. - errata-ai.vale-server
1212
- eamodio.gitlens
1313
- trond-snekvik.simple-rst
14+
15+
ports:
16+
- port: 3000

.well-known/funding-manifest-urls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/mautic/mautic/blob/5.x/funding.json

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Documentation Status][RTD badge URL]][RTD URL]
22
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3-
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)
44
<!-- ALL-CONTRIBUTORS-BADGE:END -->
55

66
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/mautic/developer-documentation-new)
@@ -124,6 +124,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
124124
<td align="center" valign="top" width="14.28%"><a href="https://github.com/shinde-rahul"><img src="https://avatars.githubusercontent.com/u/1046788?v=4?s=100" width="100px;" alt="Rahul Shinde"/><br /><sub><b>Rahul Shinde</b></sub></a><br /><a href="https://github.com/mautic/developer-documentation-new/commits?author=shinde-rahul" title="Documentation">📖</a></td>
125125
<td align="center" valign="top" width="14.28%"><a href="https://dennisameling.com"><img src="https://avatars.githubusercontent.com/u/17739158?v=4?s=100" width="100px;" alt="Dennis Ameling"/><br /><sub><b>Dennis Ameling</b></sub></a><br /><a href="https://github.com/mautic/developer-documentation-new/commits?author=dennisameling" title="Documentation">📖</a> <a href="https://github.com/mautic/developer-documentation-new/pulls?q=is%3Apr+reviewed-by%3Adennisameling" title="Reviewed Pull Requests">👀</a></td>
126126
<td align="center" valign="top" width="14.28%"><a href="http://ifeoluwafavour.hashnode.dev"><img src="https://avatars.githubusercontent.com/u/64481442?v=4?s=100" width="100px;" alt="Ife"/><br /><sub><b>Ife</b></sub></a><br /><a href="https://github.com/mautic/developer-documentation-new/commits?author=ifeoluwafavour" title="Documentation">📖</a></td>
127+
<td align="center" valign="top" width="14.28%"><a href="https://incodit.com"><img src="https://avatars.githubusercontent.com/u/6416992?v=4?s=100" width="100px;" alt="Balbinder Sumbria"/><br /><sub><b>Balbinder Sumbria</b></sub></a><br /><a href="https://github.com/mautic/developer-documentation-new/commits?author=sumbria" title="Documentation">📖</a></td>
128+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Hugo-Prossaird"><img src="https://avatars.githubusercontent.com/u/176997845?v=4?s=100" width="100px;" alt="Hugo-Prossaird"/><br /><sub><b>Hugo-Prossaird</b></sub></a><br /><a href="https://github.com/mautic/developer-documentation-new/commits?author=Hugo-Prossaird" title="Documentation">📖</a></td>
127129
</tr>
128130
</tbody>
129131
</table>

docs/design/accordion.rst

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
Accordion component
2+
###################
3+
4+
Introduction
5+
************
6+
7+
The Accordion Component allows developers to create collapsible sections within their Mautic templates. This Component is useful for organizing content into expandable and collapsible panels, enhancing the User experience by making large amounts of content more manageable.
8+
9+
10+
Template structure
11+
******************
12+
13+
The ``accordion.html.twig`` template defines this accordion component. The template employs a list structure ``<ul>`` where each item ``<li>`` represents an accordion panel. Each panel consists of a heading and a collapsible content section.
14+
15+
Key features
16+
============
17+
18+
- Clicking on the heading expands or collapses each accordion item.
19+
- The component includes ARIA attributes to improve accessibility.
20+
- You can customize the content of each accordion panel using Twig variables.
21+
22+
Applying the accordion component
23+
================================
24+
25+
To use the accordion component, include it in your template and pass the necessary data.
26+
27+
Define the content you want to include in the accordion. For example, if you want to include a group of UTM tags fields, you can define the content as follows:
28+
29+
.. code-block:: twig
30+
31+
{% set utmTagsContent %}
32+
{% for i, utmTag in form.utmTags %}
33+
{{ form_row(utmTag) }}
34+
{% endfor %}
35+
{% endset %}
36+
37+
.. vale off
38+
39+
.. note::
40+
For instance, you can loop over Form fields or any other data to generate the content dynamically.
41+
42+
.. vale on
43+
44+
Include the ``accordion.html.twig`` template in your main template and pass an array of items. Each item should have:
45+
46+
- ``id``: a unique identifier.
47+
- ``title``: the title of the accordion item.
48+
- ``padding_inline``: optional boolean to control padding within the content. Defaults to true if not defined.
49+
- ``content``: the content displays when the item expands.
50+
51+
Example:
52+
53+
.. code-block:: twig
54+
55+
{% include '@MauticCore/Helper/accordion.html.twig' with {
56+
'items': [
57+
{
58+
'id': 'UTM',
59+
'title': 'mautic.email.utm_tags',
60+
'padding_inline': false,
61+
'content': utmTagsContent,
62+
}
63+
]
64+
} %}
65+
66+
While defining a ``set`` block separately isn't strictly necessary, it can be helpful to ensure that operations relying on Twig functions keep working correctly. The ``set`` block allows you to predefine complex content or operations, making your template cleaner and more maintainable.
67+
68+
Example without the ``set`` block
69+
---------------------------------
70+
71+
If your content is simple, you can directly include it within the ``items`` array without using a ``set`` block. Here's an example:
72+
73+
.. code-block:: twig
74+
75+
{% include '@MauticCore/Helper/accordion.html.twig' with {
76+
'items': [
77+
{
78+
'id': 'Example',
79+
'title': 'Example Title',
80+
'padding_inline': true,
81+
'content': '<p>This is a simple content example.</p>',
82+
}
83+
]
84+
} %}
85+
86+
This flexibility allows you to choose the best approach based on each case.
87+
88+
Automatic CSS handling
89+
======================
90+
91+
When using the Component, all necessary CSS styles are automatically handled for you. This means that the Component comes pre-styled with classes such as ``accordion-heading``, ``accordion-wrapper``, and ``accordion-content``, ensuring a consistent and visually appealing appearance out of the box.
92+
93+
- The Component includes predefined CSS classes that manage the layout, spacing, and interactive elements of the accordion.
94+
- You don't need to add any extra CSS to make the accordion function and look visually appealing.
95+
- It uses the existing Bootstrap function for collapsing panels.
96+
- Avoid overriding these classes in your own CSS.
97+
98+
The design of the accordion makes it easy to implement, with all essential CSS styles already in place. This allows you to focus on integrating and using the component without worrying about additional styling.
99+
100+
Complete example
101+
================
102+
103+
Here is a complete example that demonstrates how to use the accordion Component in a Mautic template:
104+
105+
.. code-block:: twig
106+
107+
{% set utmTagsContent %}
108+
{% for i, utmTag in form.utmTags %}
109+
{{ form_row(utmTag) }}
110+
{% endfor %}
111+
{% endset %}
112+
113+
{% include '@MauticCore/Helper/accordion.html.twig' with {
114+
'items': [
115+
{
116+
'id': 'UTM',
117+
'title': 'mautic.email.utm_tags',
118+
'padding_inline': false,
119+
'content': utmTagsContent,
120+
}
121+
]
122+
} %}
123+
124+
For more complex structures, with dozens of accordion items, you might prefer to copy the structure and build something unique, but the best approach would be to place each content under a set block.

docs/design/availability.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Depicting availability of interface elements
2+
############################################
3+
4+
The state of interface elements is a crucial aspect of user interface design, providing visual feedback and preventing interaction when certain actions aren't allowed.
5+
6+
Working with tabs
7+
*****************
8+
9+
Mautic uses the following CSS code to style tabs which aren't available for interaction:
10+
11+
.. code-block:: css
12+
13+
.nav-tabs.nav-tabs-contained > li.disabled {
14+
cursor: not-allowed;
15+
color: var(--text-disabled);
16+
}
17+
18+
.nav-tabs.nav-tabs-contained > li.disabled > a {
19+
background-color: var(--button-disabled);
20+
pointer-events: none;
21+
}
22+
23+
This CSS accomplishes the following:
24+
25+
* Sets the cursor to ``not-allowed`` for tabs which can't be interacted with, indicating that interaction is prohibited.
26+
* Changes the text color to a predefined inactive state color.
27+
* Modifies the background color of the tab to visually represent its inactive state.
28+
* Prevent click events on the tab using ``pointer-events: none``.
29+
30+
To dynamically deactivate tabs, use JavaScript to add or remove the ``disabled`` class. Here's an example function:
31+
32+
.. code-block:: javascript
33+
34+
Mautic.togglePermissionVisibility = function () {
35+
setTimeout(function () {
36+
if (mQuery('#role_isAdmin_0').prop('checked')) {
37+
mQuery('#permissions-tab').removeClass('disabled');
38+
} else {
39+
mQuery('#permissions-tab').addClass('disabled');
40+
}
41+
}, 10);
42+
};
43+
44+
This function:
45+
46+
* Checks the state of a checkbox - ``#role_isAdmin_0``.
47+
* Adds or removes the ``disabled`` class from the permissions tab based on the checkbox state.
48+
49+
To implement inactive states for tabs:
50+
51+
1. Assign unique IDs to your tab elements.
52+
2. Use JavaScript to toggle the ``disabled`` class on the appropriate ``<li>`` elements.
53+
54+
.. note::
55+
Always use inactive states instead of hiding elements.

docs/design/feedback.rst

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
Providing effective user feedback
2+
#################################
3+
4+
When developing features, it's crucial to ensure that Users receive clear feedback and guidance when certain information or data isn't available. Instead of hiding tabs or displaying zeroed metrics, for example, adopt a proactive approach to inform and guide Users.
5+
6+
Fundamental principles
7+
**********************
8+
9+
The principles of visibility, transparency, and guidance form the foundation of an intuitive and informative user experience.
10+
11+
- **Visibility**: keep all functionalities visible, even when there's no data available.
12+
- **Transparency**: communicate that information is missing.
13+
- **Guidance**: provide instructions on how to obtain the data or activate the necessary settings.
14+
15+
Visibility ensures that Users are aware of all available functionalities, even when they're not active or populated. Transparency builds trust by clearly explaining why certain information might be missing. Guidance empowers Users by providing clear paths for action and improvement. Together, these principles transform moments of frustration into solutions, helping marketing professionals complete their tasks.
16+
17+
Practical implementation
18+
************************
19+
20+
The practical implementation of these guidelines in Mautic goes beyond avoiding blank screens. It involves creating a conversation with the User, anticipating their needs, and guiding them with minimal workload. Every informative message, call to action, or configuration tip serves as a contextual mini-tutorial, educating Users about the platform's capabilities while helping them overcome obstacles.
21+
22+
When encountering situations where data is absent, follow these guidelines:
23+
24+
- Replace empty areas or zeroed metrics with explanatory messages. For example:
25+
26+
'There's no information about the devices used yet. This happens automatically when Users interact with your Campaigns.'
27+
28+
- Include clear call to actions that guide the User on how to proceed. For example:
29+
30+
'No Email activity? Start sending some Campaigns to populate this data!'
31+
32+
- If the lack of data is due to incomplete configuration, provide direct guidance:
33+
34+
'It looks like device tracking isn't active. Go to settings to turn it on.'
35+
36+
- Help Users understand the value of the missing data:
37+
38+
'Device information helps optimize your Campaigns for different platforms. Once this data becomes available, see detailed analytics here.'
39+
40+
- Use icons, colors, or visual elements to indicate areas that need attention.
41+
42+
This approach not only improves immediate usability but also accelerates the Users' learning curve, leading to more sophisticated use of the platform over time. Users don't feel 'stuck' when encountering areas without data, but are instead motivated to explore and fill those gaps.
43+
44+
'No Results' template
45+
*********************
46+
47+
Mautic includes a reusable template for displaying informative messages when no results are available. This template offers a consistent and flexible way to provide User feedback, with options for additional actions.
48+
49+
Template structure
50+
==================
51+
52+
The 'No Results' template is a Twig template:
53+
54+
.. code-block:: twig
55+
56+
{% if tip is defined %}
57+
<div class="alert alert-info">
58+
{{ tip|trans }}
59+
{% if link is defined and (href is defined or onclick is defined) %}
60+
<a class="ml-a" href="{{href}}" onclick="{{onclick}}">{{link|trans}}</a>
61+
{% endif %}
62+
</div>
63+
{% endif %}
64+
65+
Parameters
66+
----------
67+
68+
The template accepts the following parameters:
69+
70+
- ``tip`` - required: display a translation string that contains the main message.
71+
- ``link`` - optional: a translation string for the link/button text.
72+
- ``href`` - optional: use the ``URL`` for navigation when clicking the link.
73+
- ``onclick`` - optional: JavaScript function to be executed when the link is clicked.
74+
75+
Functionality
76+
-------------
77+
78+
If you've defined ``tip``, a ``div`` with the class ``alert alert-info`` that contains the translated message displays, if not then nothing renders. If you've defined `link` and at least one of ``href`` or ``onclick``, a link below the main message displays. Configure the link to navigate to a new page with ``href`` or execute a JavaScript function with ``onclick``.
79+
80+
Usage example
81+
-------------
82+
83+
To use this template in your code, you can include it as follows:
84+
85+
.. code-block:: twig
86+
87+
{{ include('@MauticCore/Helper/no-information.html.twig', {
88+
'tip': 'Mautic.segment.no.results',
89+
'link': 'Mautic.segment.add.new',
90+
'href': '{{ path('Mautic_segment_action', {'objectAction': 'new'}) }}'
91+
}) }}
92+
93+
In this example, the template displays a message indicating that no Segments are available, with a link to create a new Segment.
94+
95+
Why provide a uniform message in the absence of results?
96+
--------------------------------------------------------
97+
98+
It ensures a uniform presentation of 'no results' messages across the platform, providing consistency in the User experience. Its flexibility allows use in various situations, from empty lists to graphs without data, adapting to different contexts. The optional link makes the template actionable, guiding the User to actions that can resolve the 'no results' situation, promoting engagement and problem resolution. Additionally, support for internationalization translates messages into different languages, making the platform more globally accessible.
99+
100+
Best practices for using the 'No Results' template
101+
--------------------------------------------------
102+
103+
To maximize the effectiveness of this template, it's important to follow some best practices. Always provide a clear and informative message in the ``tip`` parameter, ensuring that the User understands the current situation. When appropriate, include a link to an action that can help the User resolve the 'no results' situation, promoting a more interactive and solution-oriented experience. It's crucial to use specific messages for each context, avoiding generic texts like 'No results found,' which may not provide useful information to the User. Finally, include all strings in the translation files to guarantee a consistent experience in all supported languages.
104+
105+
This approach aligns with modern User experience (UX) design best practices. It incorporates principles of informative design, immediate feedback, and contextual guidance. Providing relevant information and actions at the exact moment and place where the User needs them creates an interface that not only reacts to User actions but anticipates and meets their needs.
106+
107+
Clear messages and specific guidance reduce the number of support tickets related to User confusion or 'missing' functionalities. Additionally, standardizing the handling of empty or inactive states across the platform creates a more consistent and maintainable codebase.
108+
109+
It's essential to note that, while general guidelines exist, customize implementation for each specific context. A message that works well for empty Email metrics might not be appropriate for a Campaign Report without data. Think critically about the specific context of each implementation and adapt the messages and call to actions accordingly.
2.52 KB
Loading

docs/design/images/tile.png

1.47 KB
Loading

0 commit comments

Comments
 (0)