Excerpt | ||
---|---|---|
| ||
Using the |
|
macro to display a different metadata when users view the draft or published versions |
If you want to show different versions of metadata depending on if your users are viewing the draft or published
versions when using same-space publishing you can use the view
parameter of the
message macro together with a metadata variable.
The value of the metadata ReleaseVersion is set when the transition to the Approved state occurs using the set-metadata macro.
Workflow template
Code Block | |
---|---|
RDark | {workflow:name=Using set message published and draft view} {description} The Simple Approval Workflow {description} {state:In Progress|approved=Approved|taskable=true} {approval:Review|assignable=true} {state} {state:Approved|final=true|updated=In Progress|hideselection=true} {state} {trigger:statechanged|state=Approved} {set-metadata:ReleasedVersion}@version@{set-metadata} {set-message:view=published} Published view ||Released Version |{get-metadata:ReleasedVersion}| {set-message} {set-message:view=draft} Editor view ||Released Version|{get-metadata:ReleasedVersion}| {set-message} {trigger} {trigger:statechanged|state=In Progress} {set-message:view=draft} Draft view ||Version |{get-metadata:version}| {set-message} {trigger} {workflow} |
Related Pages
First trigger
The published content will display displays the view=published
message on the public URL for the content
<hostname>/display/public/<spacekey>/<pagename>
![(info)](/wiki/s/19829951/6452/74bb90925e58a0b8983b8579f502578d16fe7cf3/_/images/icons/emoticons/information.png)
A user with edit permission viewing content in the Approved state
, by default, does not see the public URL content.
To avoid this confusion, the first trigger has a second set-message
action to cater for to this scenario so that a user with edit permission will see sees a message in the Approved state.
Second trigger
The draft content will display displays the view=draft
message.