Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Share Buttons Bundle Laravel Package

ezsystems/share-buttons-bundle

Symfony bundle that adds social share buttons (Facebook Like/Recommend, Twitter, LinkedIn, Google+, Xing) to applications, including eZ Publish 5.x and eZ Platform. Install via Composer, enable in the kernel, and configure providers per siteaccess in config.yml with default or custom templates.

View on GitHub
Deep Wiki
Context7

Share Buttons Bundle

SensioLabsInsight

This bundle adds social share buttons into Symfony applications (including eZ Publish 5.x & eZ Platform).

Requirements

  • Symfony v2.6 or later.

Installation

This package is available via Composer, so the instructions below are similar to how you install any other open source Symfony Bundle.

Run the following command in a terminal, from your Symfony installation root (pick most recent release):

php composer.phar require ezsystems/share-buttons-bundle

Enable the bundle in app/AppKernel.php file (for regular Symfony application) or ezpublish\EzPublishKernel.php file (for eZ Publish / eZ Platform):

$bundles = array(
    // existing bundles
    new EzSystems\ShareButtonsBundle\EzSystemsShareButtonsBundle()
);

Install additional assets (CSS) for default template (omit this step if you are planning to use custom stylesheets):

{% stylesheets
    bundles/ezsystemssharebuttonsbundle/css/default.css
%}
    <link rel="stylesheet" type="text/css" href="{{ asset_url }}"/>
{% endstylesheets %}

Configuration

The bundle's configuration depends on siteaccess. This is an example of settings (config.yml):

ez_share_buttons:
    system:
        default:
            # enable only those providers you are interested
            providers:
                - facebook_like
                - facebook_recommend
                - twitter
                - linkedin
                - google_plus
                - xing
            template: default
            
            facebook_like:
                # available options are: standard, box_count, button_count, button
                layout: button
                width: ~
                show_faces: true
                # displays additional `share` button
                share: false
            
            facebook_recommend:
                # available options are: standard, box_count, button_count, button
                layout: button
                width: ~
                show_faces: true
                # displays additional `share` button
                share: false

            twitter:
                show_username: false
                large_button: false
                language: ~

            linkedin:
                # available options are: top, right, none
                count_mode: none
                language: en_US

            google_plus:
                # available options are: small, medium, standard, tall
                size: medium
                # available options are: inline, bubble, none
                annotation: none
                width: ~
                language: en-GB

            xing:
                # available options are: square, none
                shape: none
                # available options are: right, top, none
                counter: none
                # available options are: de, none
                language: none

Features

Comments abstraction

ShareButtonsBundle is provider based. This means that it is open to any kind of social share services.

Single entry point

Render your social share buttons with a single line of code.

Available integration

Currently, ShareButtonsBundle is working with the following social share services:

  • Facebook like
  • Facebook recommend
  • Google Plus
  • LinkedIn share
  • Twitter
  • Xing

Usage

Insert the following Twig helper in the place where you want to display the share buttons bar:

{{ show_share_buttons() }}

You can override existing siteaccess configuration for ShareButtonsBundle by adding additional arguments:

{{ show_share_buttons(
   options = {
       provider_label: {
           key: 'value'
       },
       template: 'default'
   },
   providers = ['provider_label']
) }}

More practical example of the usage:

{{ show_share_buttons(
    options = {
        facebook_like: {
            layout: 'button_count',
            show_faces: true
        },
        google_plus: {
            size: 'small',
            annotation: 'bubble'
        }
        template: 'default'
    },
    providers = ['facebook_like', 'google_plus']
 ) }}  

License

This bundle is under GPL v2.0 license.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style