Skip to content

Commit 8a9e169

Browse files
authored
Merge pull request #210 from andersonjeccel/protip
[UX] ProTip
2 parents f448d3e + 8681e37 commit 8a9e169

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ Plugin
111111
Plugins
112112
post
113113
POST
114+
ProTip
115+
ProTips
114116
PUT
115117
PyCharm
116118
Rackspace

docs/design/protip.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
ProTip template to enhancing user experience
2+
############################################
3+
4+
The ProTip template is a powerful feature that displays helpful tips to Users, guiding them on how to use the platform like a pro. This template uses Twig. Here's how this template works and how to effectively use it in Mautic.
5+
6+
Twig template for ProTips
7+
*************************
8+
9+
The ProTip template conditionally renders a tip when provided. Here's a breakdown of its key components:
10+
11+
.. code-block:: twig
12+
13+
{% if tip is defined and tip is not empty %}
14+
<div class="col-xs-12 ai-center mt-md mb-md">
15+
<div class="text-muted">
16+
<i class="ri-lightbulb-line ri-lg"></i>
17+
<span class="fw-b">{{ 'mautic.core.protip'|trans }}</span>
18+
{{ tip|trans|raw }}
19+
</div>
20+
</div>
21+
{% endif %}
22+
23+
This template checks for the definition of a ``tip`` variable. If defined, it renders a div containing the tip. Mautic displays the tip with a bulb icon, a "ProTip" label - a translatable string - and the tip content itself.
24+
25+
The ``tip`` parameter's passed through Twig's ``trans`` filter, allowing for internationalization. The ``raw`` filter's also applied, enabling the use of HTML tags within the tip content. This is particularly useful for including elements like ``<kbd>`` tags to highlight keyboard shortcuts.
26+
27+
To include a ProTip in Mautic, use the following syntax:
28+
29+
.. code-block:: twig
30+
31+
{{ include('@MauticCore/Helper/protip.html.twig', {tip: 'mautic.core.protip.contacts.view'}) }}
32+
33+
In this example, it includes the ProTip template and passes a translation key - ``mautic.core.protip.contacts.view`` - as the tip content. This specific tip informs Users about using the ``V`` key to switch between card and table views.
34+
35+
The use of a translation key instead of a hard-coded string allows for easy localization of tips. It also promotes consistency across Mautic, as it's possible to reuse the same tip in multiple places by referencing its key.
36+
37+
Use the ProTip template to enhance the user experience of Mautic. These tips provide contextual help, highlighting shortcuts and features that Users might otherwise overlook. It's important to keep tips concise, relevant, and actionable to maximize their effectiveness in guiding Users to become 'Power Users'.

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ There are several ways to support Mautic other than contributing with code.
6161
design/feedback
6262
design/labelling
6363
design/notifications
64+
design/protip
6465
design/quick_filters
6566
design/retrieving_system_information
6667
design/tiles

0 commit comments

Comments
 (0)