PHPackages                             fritzmg/contao-sharebuttons - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fritzmg/contao-sharebuttons

ActiveContao-module

fritzmg/contao-sharebuttons
===========================

Simple Contao extension to provide share buttons as a module and content element

2.2.4(3y ago)1832.5k↓47.6%4[8 issues](https://github.com/fritzmg/contao-sharebuttons/issues)[4 PRs](https://github.com/fritzmg/contao-sharebuttons/pulls)LGPL-3.0-or-laterPHPPHP &gt;=7.1

Since Nov 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/fritzmg/contao-sharebuttons)[ Packagist](https://packagist.org/packages/fritzmg/contao-sharebuttons)[ Docs](http://www.inspiredminds.at)[ GitHub Sponsors](https://github.com/sponsors/fritzmg)[ RSS](/packages/fritzmg-contao-sharebuttons/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (56)Used By (0)

[![](https://camo.githubusercontent.com/1c335596e8603b8229b6607c2625aa7e190556e7ea720db4d6dfa7d422284c04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667269747a6d672f636f6e74616f2d7368617265627574746f6e732e737667)](https://packagist.org/packages/fritzmg/contao-sharebuttons)[![](https://camo.githubusercontent.com/dedb89cd999c0110b312964e265f8dfb5ff5568a831dd7e970a71636882c6731/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667269747a6d672f636f6e74616f2d7368617265627574746f6e732e737667)](https://packagist.org/packages/fritzmg/contao-sharebuttons)

Contao Share Buttons
====================

[](#contao-share-buttons)

Simple extension to provide share buttons as a module, content element and for news articles in Contao. In each case you have the same set of options.

[![Element settings](https://raw.githubusercontent.com/fritzmg/contao-sharebuttons/master/element.png)](https://raw.githubusercontent.com/fritzmg/contao-sharebuttons/master/element.png)

Themes
------

[](#themes)

In each case you can also set an optional theme. If you select a theme, basic styling is included for the buttons, making them align horizontally and applying background images. These are the current available themes:

[![Available themes](https://raw.githubusercontent.com/fritzmg/contao-sharebuttons/master/buttons.png)](https://raw.githubusercontent.com/fritzmg/contao-sharebuttons/master/buttons.png)

From top to bottom:

- Boxxed
- Boxxed (16px)
- Contao
- Light
- Shadow
- Simple Flat
- Simple Icons Black
- Simple Icons White (grey background added for visibility)
- Font Awesome

The "Contao" theme uses Contao's own icons, however only Facebook, and Twitter is available there. There is also a theme called "Text", which simply aligns the elements horizontally, but leaves the textual content of each button visible.

The following themes offer higher resolution images for devices with high DPI:

- Boxxed (16px)
- Light
- Shadow
- Simple Flat
- Simple Icons Black
- Simple Icons White

Template
--------

[](#template)

You can also set the template in each element, if you happen to need a different structure in some cases. If you want to use your own template, create one with a name that starts with `sharebuttons_` in your templates folder.

Font Awesome
------------

[](#font-awesome)

Since version 1.1.0 there is also a theme and template for Font Awesome icons. If you have the Font Awesome icon font integrated on your page and want to use it for your share buttons, simply select the `sharebuttons_fontawesome` template. Theme wise you can choose between *None*, *Text* and *Font Awesome*. The latter one comes with some styles that will make the icons about as big as the other themes. If you select any theme other than those three and you have the template selected, it will default to the *Font Awesome* theme currently.

If you want to exchange the icons for one of the buttons simply create your own `sharebuttons_fontawesome` template (or rename it to something else) and replace the `fa-` class. For example, if you want the square version of the facebook icon, simply replace `fa-facebook` with `fa-facebook-square`.

News, Events, Articles
----------------------

[](#news-events-articles)

You can output share buttons directly in your `news_*`, `event_*` and `mod_article*` templates:

```

```

You can set the options for the news sharebuttons in the news archive, calendar or article settings.

Using the share buttons this way is especially important if you want to show share buttons in a news or event list or when you show article teasers — otherwise the url and title will not be correct (since the share buttons just use the url and title of the current page then).

Insert Tag
----------

[](#insert-tag)

Since version 1.1.0 there is also an insert tag available. The name of the insert tag is `sharebuttons`, parameters like theme, template and networks can be passed as following:

```
{{sharebuttons::THEME::TEMPLATE::NETWORK:NETWORK:...}}

```

All parameters are optional (however, without any networks, nothing will be displayed). The following insert tag would create share buttons with the `boxxed` theme with all currently available social networks:

```
{{sharebuttons::boxxed::facebook:twitter:linkedin:xing:mail:tumblr:pinterest:reddit:whatsapp:print:pdf}}

```

The following insert tag would simply generate the HTML source for a Facebook and Twitter share button, without including a stylesheet for a theme:

```
{{sharebuttons::facebook:twitter}}

```

Have a look at the `$GLOBALS['sharebuttons']['themes']` and `$GLOBALS['sharebuttons']['networks']` array in [`config/config.php`](https://github.com/fritzmg/contao-sharebuttons/blob/master/system/modules/sharebuttons/config/config.php) in order to find the key-string for your desired networks and theme.

Since version `2.1.0` you can also define an article ID, if you want to provide a PDF link for a specific article:

```
{{sharebuttons::pdf::6}}

```

Pinterest button
----------------

[](#pinterest-button)

The Pinterest share button will only be displayed, if an image is available. There are 3 ways an image can be present:

- If you use the sharebuttons in your news or event template via ``, the Pinterest button will automatically use the teaser image.
- Simply install the [social\_images](https://github.com/codefog/contao-social_images) extension (also available in the [ER2](https://contao.org/de/extension-list/view/social_images.en.html)) and enable it in your layout. The Pinterest share button will automatically take the first social image available.
- You can also manually set a social image by providing an absolute URL to the image in `$GLOBALS['SOCIAL_IMAGES'][0]` in any template or PHP script *before* the sharebuttons are generated.

Attributions
------------

[](#attributions)

### Icon sources

[](#icon-sources)

- Boxxed:
- Light:
- Shadow:
- Simple Flat:
- Simple Icons:

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~57 days

Recently: every ~182 days

Total

55

Last Release

1110d ago

Major Versions

0.3.2 → 1.0.02014-11-17

1.3.9 → 2.0.02018-01-09

PHP version history (5 changes)0.1.0PHP &gt;=5.2

1.3.4PHP &gt;=5.4

2.1.0PHP &gt;=7.1

2.1.6PHP ^7.1

2.2.2PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/25f6ec05570f72d0fcc4d0a4fef2309799d53badf8b30484284e73724661e0d8?d=identicon)[fritzmg](/maintainers/fritzmg)

---

Top Contributors

[![fritzmg](https://avatars.githubusercontent.com/u/4970961?v=4)](https://github.com/fritzmg "fritzmg (49 commits)")

---

Tags

contaocontao-modulefacebooktwittercontaosocialbuttonsshare

### Embed Badge

![Health badge](/badges/fritzmg-contao-sharebuttons/health.svg)

```
[![Health](https://phpackages.com/badges/fritzmg-contao-sharebuttons/health.svg)](https://phpackages.com/packages/fritzmg-contao-sharebuttons)
```

###  Alternatives

[hybridauth/hybridauth

PHP Social Authentication Library

3.4k8.5M94](/packages/hybridauth-hybridauth)[social-links/social-links

PHP library to generate share buttons

112338.6k2](/packages/social-links-social-links)[pdir/social-feed-bundle

Social feed extension for Contao CMS

1414.8k](/packages/pdir-social-feed-bundle)[kartik-v/yii2-social

Module containing useful widgets for Yii Framework 2.0 that integrates social functionalities from DISQUS, Facebook, Google etc.

91256.5k8](/packages/kartik-v-yii2-social)[ryannielson/shareable

A Laravel 4 package to make it easy to add social sharing buttons to your application.

222.8k](/packages/ryannielson-shareable)[mvo/contao-facebook-import

Facebook posts and events for Contao Open Source CMS

102.7k1](/packages/mvo-contao-facebook-import)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
