set-message macro
Overview
Use the set-message macro to display an on-screen message.
It's great for keeping the user informed during the content production process when a workflow event or change occurs.
messages are shown between the page title and body content whilst viewing content (it's hidden from the edit screen)
messages can be configured as different panel displays
info
error
warning
success
if triggered by
stateexpired
ortaskexpired
events, the message is not shown until the page is refreshed
The set-message macro can be filtered to display the message only to a specific user(s).
A message filtered to display to a specific user includes an option for the user to remove it.
Messages filtered for users are removed after the user has viewed the message.
Messages can also be filtered using the view
parameter to display a message on the workflow draft content URL or the workflow published content URL when the applied workflow has a final state.
The message is removed and replaced when a new trigger event occurs that includes a new set-message
action macro (if the message is for the same audience). The message is cleared if the set-message
macro in the trigger is empty.
Where to use it?
Optional.
One or more set-message
macros can be added as action macros in a trigger macro.
{trigger:statechanged|state=Rejected}
{set-message}
The page content has been rejected. The content must be triaged.
{set-message}
{trigger}
A filter can be added to display the message to specific audiences - for example to one or more users, one or groups
{trigger:statechanged|state=Draft}
{set-message:user=@user@}
The page content has been moved to the Draft state. The content must be triaged before submitting for approval.
{set-message}
{trigger}
If more than one set-message
macro is added to a trigger
only one message will be displayed on the page if all the messages are for everyone (unfiltered)
more than one
set-message
macro in the trigger will be displayed on the page if at least one of them is filtered to be displayed to a user(s), group(s) or the draft/published content
Parameters
Parameter | Required | Default | Notes | Ver |
---|---|---|---|---|
unnamed first parameter |
|
| Deprecated Use the | Deprecated v5.2 |
macro body | The message to display:
| |||
Replaces an existing message to the same audience; if the macro body is empty, the message panel is removed for that audience. {set-message}{set-message} A message that included | ||||
| How long should the message be displayed from the point at which it is set?
| |||
Default behavior depends on message audience:
In both cases, specifying a | ||||
| unfiltered | Only show to users in specific user group(s)?
The on-screen display of a message filtered to a specific group(s) can be removed from the screen for that member of the group using an X option displayed in the message panel. The option to remove the message is not displayed if a Filter by labelThere are no items with the selected labels at this time. | 5.2 | |
|
| Message style: o o o o if no | 4.1 | |
Obsolete The | ||||
| unfiltered | Only show to specific user(s)?
The on-screen display of a message filtered to a specific user(s) can be removed from the screen for that user by using an X option displayed in the message panel. The option to remove the message is not displayed if a | ||
|
| Which types of content URL should the message be shown on? Default - no inclusion of the parameter or value. The undisplayed parameter default value is
When | 5.2 | |
This parameter determine which URL the message is shown when using same-space publishing:
If you're not using same-space publishing, all users see the normal URL by default.
| ||||
For example, If
But this message is not displayed when viewing the last approved version for a page with an applied workflow that includes a final state. The viewer sees this content URL with the
| ||||
The
Unfiltered messages, those which do not specify user or group, are treated separately:
|
Removing a message
An empty set-message
macro body in a trigger can be used to remove a previously set message.
For example, adding the following message on a state transition
This can be removed in a subsequent transition using an empty set-message
macro in the trigger.
Although the set-message
macro included a parameter to define the style of the message, both this set-message
macro and the empty set-message
macro are unfiltered - they are displayed to the same audience - and the message is removed.
If you have the following two messages displayed - one filtered using view=draft
and one unfiltered - they are considered as being for different audiences.
Using the following in a trigger will only remove the unfiltered warning message.
To remove both messages the trigger will need to include an empty set-message
macro for each different audience.
Removing a workflow
If an applied workflow is removed from content
any displayed
set-message
macro messages are removed from the document.
If the workflow is removed without clearing the document activity
previous on-screen messages will be displayed on reapplying the workflow (if the state has not been initialized)
Examples
Adding a filtered set-message
macro and an unfiltered set-message
macro to the same trigger
A transition to the Test state adds two on-screen notifications to the page.
The message from each set-message
macro are both displayed as they are considered to be for different audiences
at least one of the macros is filtered using an added user parameter value or group parameter value
unfiltered messages are shown in addition to any messages filtered to users
The second message is specific to the user who actioned the transition and is only displayed to this user. This message can be removed by the user using the X option in the message.
Adding one or more unfiltered set-message
macros to the same trigger
If a trigger has two or more set-message
macros with no filter (no user
, group
or view
parameter added to any of the macros).
only the last
set-message
macro content before the closing trigger will be the message displayed on the page on the transition
The first set-message
macro action in the trigger is superseded by the second set-message
macro.