Social networksIntegration manual


  1. Installation
  2. Graphic integration aids
    1. "Helpers Facebook
      1. Like" button
      2. Share" button
    2. "Google+ "Helper
    3. "Helper ShareThis
    4. "Helper sent by mail

Installation

  • Stop the server
  • Download jars from plugin and add them (ametys-plugin-socialnetworking-1.x.x.jar and ametys- plugin-socialnetworking-resources-1.x.x.jar) in the WEB-INF/lib directory of your application. Ametys
  • Restart the server

Graphic integration aids

This plugin provides help ("helper") in the form of templates XSL for the creation of graphic charters, linked to social networks: Twitter, Facebook, ShareThis, Google+ or sending of mail

"Helpers Facebook

Like" button

This "helper" lets you add the Facebook "Like" button to your pages. This button allows users to share content with their Facebook friends.

Three button templates are available:

NameRendering

standard

button_count

box_count

To insert the "Like" button, import the xslt style sheet into your template. XSL

 

<xsl:import href="plugin:socialnetworking://stylesheets/helpers/facebook.xsl" />

Then use the template named FB_like

 

<xsl:call-template name="FB_like">
    <xsl:with-param name="absoluteUrl"><xsl:value-of select="concat($absolute-site-uri-prefix, '/', $lang, '/', $page-path, '.html')"/></xsl:with-param>
    <xsl:with-param name="rendering-context"><xsl:value-of select="$rendering-context"/></xsl:with-param>
    <xsl:with-param name="layout">standard</xsl:with-param>
</xsl:call-template>

 

The template accepts the following parameters:

ParameterDescription

absoluteUrl

Theurl absolute page

layout

Button template: 'standard', 'button_count' or 'box_count'.
By default, the "standard" template is used.

action

like' or 'recommend. Verb to display: Like/J'aime or Recommend/Je recommande
By default, the "like" action is used.

showFaces

true to display the profile thumbnail below the button.
true by default.

width

Width in pixels.
450px by default.

height

Height in pixels.
80px by default.

colorsheme

Theme color: 'light' or 'dark'.
The default is "ligth".

Share" button

This "helper" lets you add Facebook 's "Share" button to your pages. This button allows users to share content with their Facebook friends.

Three button templates are available:

NameRendering

button

button with counter

icon

box

To insert the "Share" button, import the xslt style sheet into your template. XSL

<xsl:import href="plugin:socialnetworking://stylesheets/helpers/facebook.xsl" />

Then use the template named FB_share

<xsl:call-template name="FB_share">
    <xsl:with-param name="text"><i18n:text i18n:key="SKIN_FACEBOOK_SHARE_TEXT"/></xsl:with-param>
    <xsl:with-param name="layout">box</xsl:with-param>
    <xsl:with-param name="rendering-context"><xsl:value-of select="$rendering-context"/></xsl:with-param>
</xsl:call-template>

The template accepts the following parameters:

ParameterDescription

text

Button text. Default is "Share".

layout

Button template: 'button', 'icon' or 'box'.
By default, the "button" template is used.

counter

true to display a counter.
false by default.

"Google+ "Helper

This "helper" lets you add the "Google+" button to your pages. This button allows users to share content with Google+.

4 sizes available: small, medium, standard or tall

NameRendering
small
medium
standard
tall

For each size (except "tall") it is possible to display the counter or not.

To insert the Google+ button, import the xslt style sheet into your template. XSL

<xsl:import href="plugin:socialnetworking://stylesheets/helpers/google.xsl" />

Then use the template in the desired location:

<xsl:call-template name="GOOGLE_plus_one">
    <xsl:with-param name="counter">true</xsl:with-param>
</xsl:call-template>

The template accepts the following parameters:

ParameterDescription

size

Button size: small, medium, standard or tall.
By default, "standard" is used.

counter

true / false to display or not the counter.
If the "small" size is used, the counter will always be displayed.

lang

Counter language.
Defaults to the language of the current page.

urlUrl to share.
The default is the currenturl

 

"Helper ShareThis

This "helper" lets you add the "ShareThis" gadget to your pages. This gadget allows users to share content on the social network of their choice (Twitter, Facebook, Google+, LinkedIn, Pinterest) or via email.

5 templates are available:

TemplateRendering
classic
multi-channel
multi-channel-large

vertical-counter

 

horizontal-counter

To insert the widget ShareThis, import the XSLT style sheet into your template. XSL

 <xsl:import href="plugin:socialnetworking://stylesheets/helpers/sharethis.xsl" />

Then use where you want the template:

<xsl:call-template name="ShareThis">
     <xsl:with-param name="layout">multi-channel</xsl:with-param>
</xsl:call-template>

By default, 7 shares are active: Twitter, Facebook, LinkedIn, Google Plus, Pinterest, Mail and ShareThis. Each of these links can be disabled via a parameter in the XSL ShareThis template. In the example below, Google+, Pinterest and mail are disabled:

<xsl:call-template name="ShareThis">
     <xsl:with-param name="layout">multi-channel</xsl:with-param>
     <xsl:with-param name="feature-gooleplus">false</xsl:with-param>
     <xsl:with-param name="feature-pinterest">false</xsl:with-param>
     <xsl:with-param name="feature-mail">false</xsl:with-param>
</xsl:call-template>

"Helper sent by mail

This "helper" lets you add a "send by mail" link to your pages. The link opens a popup allowing users to send the link to the current page by mail to the recipients of their choice.

Please note that this feature does not use ShareThis' mail functionality, mails are sent by CMS Ametys .

To insert the "send by mail" link, import the XSLT style sheet into your XSL template:

 <xsl:import href="plugin:socialnetworking://stylesheets/helpers/sendByMail.xsl" />

Then use the "sendByMailForm" template in the desired location:

<xsl:call-template name="sendByMailForm">
      <xsl:with-param name="link-content"><img src="{ametys:skinURL('img/mailto.png')}"/><i18n:text i18n:key="PLUGINS_SOCIAL_NETWORKING_SEND_MAIL_INFO" i18n:catalogue="plugin.socialnetworking"/></xsl:with-param>
</xsl:call-template>

The parameter link-content is the HTML link content. By default it simply contains the text "Send by mail", you can override it to modify the text, add an image, etc...


Back to top

Social networking