Git Product home page Git Product logo

networkteam.neos.shariff's Introduction

Networkteam.Neos.Shariff

Social plugins are on every page today, but if you have concerns about privacy of your visitors it is not that easy to integrate them. The german publisher Heise created a general solution that allows to show the counts for each share while preserving the privacy of website visitory. This is accomplished by using the server of the website as proxy for the visitors. http://ct.de/-2467514

This plugin integrates Shariff into Neos with a few simple steps.

Installation

$ composer require networkteam/neos-shariff

Compatibility

See the following table for the correct plugin version to choose:

Neos CMS Plugin version
>= 4.3 5.x
< 5.0 4.x
< 4.0 3.x
< 3.0 2.x
< 2.0 1.x

Configuration

Configure the list of services to show in a Settings.yaml (e.g. in your site package):

Networkteam:
  Neos:
    Shariff:
      options:
        services:
          - WhatsApp
          - Twitter
          - Facebook
          - Pinterest
          - Mail

See Configuration/Settings.yaml for more information about possible options.

Usage

As a content element

This package contains a simple node type Networkteam.Neos.Shariff:Shariff that renders social share buttons via Shariff. Just add a new node of this type to a document in the Neos backend.

Usage via Fusion

In your prototype define a property which renders the social plugins like this:

prototype(My.Awesome.Package:Post) {
    socialButtons = Networkteam.Neos.Shariff:Shariff
}

Then in the corresponding template render the path like this:

{socialButtons -> f:format.raw()}

Configuration

Shariff is configured by data-attributes. A basic set of these attributes is already defined by package settings.

  • data-backend-url
  • data-services
  • data-theme
  • data-orientation
  • data-lang

You can override them in your settings.yaml.

Networkteam:
  Neos:
    Shariff:
      frontend:
        theme: standard
        orientation: horizontal
        language: en
      options:
        domain: ~
        cache:
          ttl: 3600
        services:
#          - Facebook
#          - Twitter
#          - LinkedIn
#          - Reddit
#          - StumbleUpon
#          - Flattr
#          - Pinterest
#          - Xing

If you want to extend the configuration just go like this:

prototype(Networkteam.Neos.Shariff:Shariff) {
    attributes {
        // Put additional attributes here, see https://github.com/heiseonline/shariff#options-data-attributes
        // data-example = 'value'
    }
}

Using Pinterest

In order to use a "Pin it" button in shariff pinterest won't grab an image of your page automatically. You have to define one by using the "data-media-url" attribute. So just extend prototype(Networkteam.Neos.Shariff:Shariff) and use e.g. the twitterCardImage property of the current Document Node to serve a proper image.

Development

When you publish a new version, make sure to run npm run-script build. This will update the Shariff package and copy the assets into public folder. After build check in the modified files.

Acknowledgments

Development of the Neos integration sponsored by networkteam GmbH - Neos Agentur.

License

Licensed under GPLv2+, see LICENSE.

networkteam.neos.shariff's People

Contributors

bbehrendt-mm avatar comir avatar esdete2 avatar ger4003 avatar hlubek avatar kdambekalns avatar monofone avatar networkteamcom avatar nilsjung avatar suffle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

networkteam.neos.shariff's Issues

E-Mail sharing not working (?)

Hey,

It seems that somehow the E-Mail function is not working. If I click on the "Share with Mail" button, I will only get redirected to http://site.localhost/site.html?view=mail

These are my Settings:
Settings.yaml

Networkteam:
  Neos:
    Shariff:
      options:
        domain: 'http://site.localhost'
        services:
          - WhatsApp
          - Twitter
          - Facebook
          - LinkedIn
          - Xing
          - Mail

I am also gettings this error on the console everytime I load the page:

Uncaught TypeError: o.getJSON is not a function
    at e.value (shariff.min.js:7)
    at new e (shariff.min.js:7)
    at HTMLDivElement.<anonymous> (shariff.min.js:7)
    at Function.each (jquery.slim.min.js:2)
    at E.fn.init.each (jquery.slim.min.js:2)
    at HTMLDocument.<anonymous> (shariff.min.js:7)
    at e (jquery.slim.min.js:2)
    at t (jquery.slim.min.js:2)

add a div block outside the shariff block

Hi,

how can i add an div block around the shariff div? I found no template for your plugin.

When I put the Shariff-PlugIn in the neos backend then it create this frontendcode:
<div class="shariff" data-backend-url="null" data-services="["twitter.......

But I need a <div> before:
<div><div class="shariff".....

How can I do that?

error $ is not a function. (ln '$(".shariff")'....

Hi Networkteam,

my browser (dev-tools) shows an error:
$ is not a function. (In '$(".shariff")', '$' is "query")

in this file: Resources/Public/shariff/build/shariff.min.js

Is that a bug? How can I fix it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.