AddThis plugin has been discontinued by Oracle on May 31, 2023 and it has been replaced by AddToAny starting from DSpace CRIS 7 release 2023.01.00.

By means of the AddToAny plugin, it is possible to share DSpace-CRIS content with common Social Media Platforms.

Configuration

The AddToAny plugin can be enabled and configured through the Angular environment property addToAnyPlugin. It is also possible to decide on which pages it should be enabled by configuring the Angular router.

The AddToAny plugin is enbled by default. In order to disable it you need to set the Angular environment property addToAnyPlugin.socialNetworksEnabled to false.

addToAnyPlugin:
  socialNetworksEnabled: false

Environment properties

The Angular environment property addToAnyPlugin provides the following configuration properties:

  • scriptUrl is the URL of the script that enables the plugin

  • socialNetworksEnabled is a boolean flag that allow to enable the plugin

  • buttons is an array of strings that contains the IDs of available buttons

  • showPlusButtons is a boolean flag that enables the plus sign button that shows all available share options

  • showCounters is a boolean flag that shows the share count for each service that provides a public API

  • title is a string that may be used as title, content, or subject for the shared post

  • link is an optional string containing the address of the DSpace installation,

This is the default plugin configuration in default-app-config.ts:

  addToAnyPlugin: AddToAnyPluginConfig = {
    scriptUrl: 'https://static.addtoany.com/menu/page.js',
    socialNetworksEnabled: false,
    buttons: [],
    showPlusButton: true,
    showCounters: true,
    title: 'DSpace CRIS 7 demo',
  };

This is an example of configuration override in config.ENVIRONMENT.yml file:

addToAnyPlugin:
  scriptUrl: "https://static.addtoany.com/menu/page.js"
  socialNetworksEnabled: true
  buttons:
    - facebook
    - twitter
    - linkedin
    - email
    - copy_link
  showPlusButton: true
  showCounters: true
  title: DSpace CRIS 7 demo
  link: "https://dspacecris7.4science.cloud/"

vailable social networks - First method

Search the desired service in the following list, then copy the service code and add it to the buttons property:

Services - AddToAny

Available social networks - Second method

Another way to get the button IDs is to generate the button code on AddToAny website.

Open Share Buttons Code for Any Website - AddToAny, then click “Choose services” and select the desired services:

Then click “Get button code” to generate the HTML code:

<!-- AddToAny BEGIN -->
<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
<a class="a2a_button_facebook"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_email"></a>
</div>
<script async src="https://static.addtoany.com/menu/page.js"></script>
<!-- AddToAny END -->

For each button you will get an anchor element containing the button ID:

<a class="a2a_button_BUTTON-ID"></a>

In order to add the buttons you can copy all the IDs and add them to the button array.

Note that you don’t need this HTML code, but only need the button IDs. The HTML code is automatically generated by DSpace CRIS.

Angular Router

Configure the Angular Router to activate the feature in every desired route (you may want to include just informative pages in order to exclude administrative pages or edit pages).

Add showSocialButtons: true to the data object of each configured route

{
  path: ':id',
  data: {
    showSocialButtons: true
  }
}

The AddToAny container element will then be positioned inside the page accordingly to the widget configuration.

GDPR and CCPA compliance

Accorting to what reported at https://www.addtoany.com/buttons/faq/#data-privacy, AddToAny does not store personal data and does not require the user to accept any privacy policy.

  • No labels