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) override the service rendering in your charter: skins/[NON_SKIN]/services/web/pages/services/attach/attachments-tree_3.3.xsl

2) import the 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

The template XSLT "page-subscription" can be configured to modify default texts (link texts, form texts, confirmation or success messages)
For example, you can replace "Subscribe to page" with "Watch".

<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;


See the helper XSLT for further customization options.

Why subscribe?

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

The applications depend on the customization of your application Ametys CMS .

By default, subscribers will be notified by mail of the following events:

  • add/modify/delete an attachment on the page
  • page content validation
  • delete page

Note
The person validating the content, if a subscriber, does not receive the email notification.

Back to top

Subscription page