This bundle adds social share buttons into Symfony 2 application (eZ Publish / eZ Platform).
- any Symfony v2.6 or newer application.
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
(for regular Symfony application) or ezpublish\EzPublishKernel.php
(for eZ Publish / eZ Platform):
$bundles = array(
// existing bundles
new EzSystems\ShareButtonsBundle\EzSystemsShareButtonsBundle()
);
Install additional assets (CSS) for default template (bypass this step if you're planning to use custom stylesheets):
{% stylesheets
bundles/ezsystemssharebuttonsbundle/css/default.css
%}
<link rel="stylesheet" type="text/css" href="{{ asset_url }}"/>
{% endstylesheets %}
The bundle's configuration is siteaccess aware. 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
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
ShareButtonsBundle is provider based. This means that it is open to any kind of social share services.
Render your social share buttons with a single line of code.
ShareButtonsBundle currently works with the following social share services:
- Facebook like
- Facebook recommend
- Google Plus
- LinkedIn share
Place following Twig helper in place where you want to display 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 use:
{{ 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']
) }}
This bundle is under GPL v2.0 license.