Integration manual


plugin provides a XSLT helper for inserting a "Subscribe to this page" link in your pages.

This link can be inserted into the graphic rendering of a content or service, or into the site's graphic charter.

Example of use: insertion in the "Page attachments" service

To insert a "Manage my page subscription" link in a page's attachments service:

1) surchargez dans votre charte le rendu du service: skins/[NON_SKIN]/services/web/pages/services/attach/attachments-tree_3.3.xsl

2) importez le helper XSLT plugin:page-subscription://stylesheets/helpers/page-subscribe.xsl

3) call up the XSLT template "page-subscription" in the desired location

<xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
        xmlns:ametys="org.ametys.web.transformation.xslt.AmetysXSLTHelper"
        exclude-result-prefixes="ametys">
    
    <xsl:import href="plugin:web://pages/services/attach/attachments_tree_3.3.xsl"/>
    <xsl:import href="plugin:page-subscription://stylesheets/helpers/page-subscribe.xsl"/>
    
    <!-- Used by common -->         
    <xsl:template name="common-service-head-css">    
        <link type="text/css" rel="stylesheet" href="{ametys:skinURL('css/services/attach.css')}" media="screen, print, handheld"/>    
    </xsl:template>   

    <xsl:template name="common-service-body-nonempty-content-content">
        <xsl:call-template name="attachment-list"/>
        
        <xsl:call-template name="page-subscription"/>
    </xsl:template>
</xsl:stylesheet>     

Note
The title and action of the link differ depending on whether the user is logged in or not, subscribed or not, and whether the page is cacheable or not. There are several possible scenarios:
- if the user is not connectedthe link is entitled "Manage my subscription on the page" and the user must enter his mail address and what he wants to do: subscribe or unsubscribe.

- if the user is connected and not subscribed to the page, a simple confirmation will be requested. The title of the link is "Subscribe to the page" if the page is not cacheable, or "Manage my subscription on the page" if the page is cacheable.

- if the user is connected and subscribed to the page, a simple confirmation will be requested. The title of the link is "Unsubscribe to the page" if the page is not cacheable, or "Manage my subscription to the page" if the page is cacheable.

Customize links

Le template XSLT "page-subscription" est paramétrable pour modifier les textes par défaut (textes des liens, du formulaire, des messages de confirmation ou de succès)
Il est possible par exemple de remplacer "S'abonner à la page" par "S'abonner aux pièces jointes de la page".

<xsl:template name="page-subscription">
     <xsl:with-param name="subscribe-link-content">S'abonner aux pièces jointes de la page</xsl:with-param>
     <xsl:with-param name="unsubscribe-link-content">Se désabonner aux pièces jointes de la page</xsl:with-param>
     <xsl:with-param name="subscribe-success-message">&lt;p&gt;Votre abonnement &lt;b&gt;aux pièces jointes&lt;/b&gt; a bien été prise en compte&lt;/p&gt;</xsl:with-param>
     ....
 </xsl:template>

Attention
Si du code HTML est utilisé, il doit être échappé : <p>hello</p> => &lt;p&gt;hello&lt;/p&gt;


Voir le helper XSLT pour les autres possibilités de personnalisation.

Why subscribe?

The effect of subscribing to a page is to register the mail address of the user subscribing to the page.

Les applications dépendent des personnalisation de votre application Ametys CMS. Par défaut il est utile de s'abonner à une page uniquement si la page contient un service "Pièce jointes". En effet, à chaque ajout/modification/suppression d'une pièce jointe sur la page, l'ensemble des abonnés recevront un mail pour être avertir de la modification.

A ce jour, les pièces jointes de la page est la seule application disponible dans Ametys mais vous pouvez mettre en place d'autre cas d'utilisation.

 

Back to top

Subscription page