Choosing Share Providers
Choose providers according to the feature you need. A provider that creates share links may not support follower or share counts, so use the corresponding capability-specific collection.
For example, an article template might offer a share button for every provider that supports sharing, without listing each one by hand.
{% for provider in craft.socialShare.getShareButtonProviders() %}
{{ craft.socialShare.renderShareButton(provider.handle, {
theme: {
showLabel: true,
},
}) }}
{% endfor %}Each provider has a name, handle, primaryColor and icon, so you can also build your own markup from these lists. Rendering Social Buttons covers the button calls.
Listing Providers
craft.socialShare.getProviders() returns an array of every Provider object Social Share supports, whatever it can do. It takes no arguments. Use it when you're building ordinary profile Buttons, which every provider supports.
Getting One Provider
craft.socialShare.getProvider(handle) returns the Provider with the given handle, or null if there isn't one. handle is required and must match exactly, such as facebook or linkedIn. Use it to read a single provider's details, such as its brand colour.
{% set facebook = craft.socialShare.getProvider('facebook') %}
{% if facebook %}
<p style="color: {{ facebook.primaryColor }}">Follow us on {{ facebook.name }}</p>
{% endif %}Listing Providers by Feature
craft.socialShare.getFollowersCountProviders() returns an array of the Provider objects that support Follower Counts. It takes no arguments. Some of these need credentials before they return a count, as listed on that page.
craft.socialShare.getSharesCountProviders() returns an array of the Provider objects that support Share Counts. It takes no arguments.
craft.socialShare.getShareButtonProviders() returns an array of the Provider objects that support Share Buttons. It takes no arguments.