Transformation of proposed content


Since version 2.3.0 of plugin UGC, you can choose to integrate your proposed content by transforming it into other content and integrating it into a site page.

To this end, plugin UGC provides 2 "helpers" to moderate your content.

Accepting and transforming proposed content

In this mode, to integrate proposed content :

  • you choose the type of target content
  • choose a target page (optional)

The initial content is deleted, and new content is created, associated by default with the standard lifecycle.

To add a button to use this mode, you'll need to declare a button like this:

<extension ref-id="org.ametys.plugins.ugc.Accept" 
           id="org.ametys.plugins.default-ugc.Accept" 
           point="org.ametys.core.ui.RibbonControlsManager" 
           class="org.ametys.plugins.ugc.clientsideelement.UGCContentModerationClientSideElement"> 
     <right context-prefix="/cms">Default_UGC_Right_Handle</right> 
</extension> 

This example defines a button using the default parameters (messages, text, lifecycle, etc.) and adding only a specific right to access the button.

However, it is possible to customize help messages, the lifecycle used for created content, etc...

Reject proposed content

When a piece of content is rejected, it will be deleted. It is possible to notify the author of this deletion and add a comment on the reason for the rejection.

To add a button to reject content in this mode, you'll need to declare a button like this:

<extension ref-id="org.ametys.plugins.ugc.Refuse" 
           id="org.ametys.plugins.default-ugc.Refuse" 
           point="org.ametys.core.ui.RibbonControlsManager" 
           class="org.ametys.plugins.ugc.clientsideelement.UGCContentModerationClientSideElement"> 
     <right context-prefix="/cms">Default_UGC_Right_Handle</right> 
</extension> 

Notify author of content moderation

When content is refused or published, it is possible to warn the author of the content using 2 "observers" provided by plugin UGC.

These "observers" send a mail to the author of the content and can be configured to define the i18n keys that will be used to make up the object and message of the mail.

Here's an example of how to activate these notifications

<extension point="org.ametys.core.observation.ObserverExtensionPoint" 
           id="org.ametys.plugins.ugc.observation.UGCContentValidatedObserver" 
           class="org.ametys.plugins.ugc.observation.UGCContentValidatedObserver"> 
    <!-- Observer for observing content validation --> 
    <mailSubjectKey>plugin.default-ugc:PLUGINS_DEFAULT_UGC_ACCEPT_MAIL_SUBJECT</mailSubjectKey> 
    <mailBodyKey>plugin.default-ugc:PLUGINS_DEFAULT_UGC_ACCEPT_MAIL_BODY</mailBodyKey> 
</extension> 

<extension point="org.ametys.core.observation.ObserverExtensionPoint" 
           id="org.ametys.plugins.ugc.observation.UGCContentRefusedObserver" 
           class="org.ametys.plugins.ugc.observation.UGCContentRefusedObserver"> 
    <!-- Observer for observing content refuse --> 
    <mailSubjectKey>plugin.default-ugc:PLUGINS_DEFAULT_UGC_REFUSE_MAIL_SUBJECT</mailSubjectKey> 
    <mailBodyKey>plugin.default-ugc:PLUGINS_DEFAULT_UGC_REFUSE_MAIL_BODY</mailBodyKey> 
</extension> 

Messages i18n support the following parameters:

  • authorFullName: full name of content author
  • contentTitle: content title
  • creationDate: creation date
  • siteTitle: site title
  • urilink to the page in which the content was inserted
  • comment: comment (in case of refusal only)

Examples:

<message key="PLUGINS_DEFAULT_UGC_ACCEPT_MAIL_SUBJECT">[{siteTitle}] Contenu publié</message> 
<message key="PLUGINS_DEFAULT_UGC_ACCEPT_MAIL_BODY">{authorFullName},&#13;&#13;Nous avons le plaisir de vous informer que votre contenu "{contentTitle}" proposé le {creationDate} sur le site {siteTitle} a été accepté et mis en ligne.&#13;Vous pouvez le consulter dès à présent en suivant le lien ci-après: {uri}.&#13;&#13;Nous vous remercions de votre contribution.</message> 
<message key="PLUGINS_DEFAULT_UGC_ACCEPT_MAIL_BODY_ORPHAN">{authorFullName},&#13;&#13;Nous avons le plaisir de vous informer que votre contenu "{contentTitle}" proposé le {creationDate} sur le site {siteTitle} a été accepté et mis en ligne.&#13;&#13;Nous vous remercions de votre contribution.</message> 

The author of proposed content will not be notified that it has been put online until the content has been validated.
Indeed, after the acceptance stage, the content is transformed and then inserted into a page, but not validated if the standard lifecycle is used.

Back to top

UGC