Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Icon" Attribute on Social Button #2

Open
ColinTravis opened this issue Mar 14, 2023 · 2 comments
Open

"Icon" Attribute on Social Button #2

ColinTravis opened this issue Mar 14, 2023 · 2 comments
Labels

Comments

@ColinTravis
Copy link

ColinTravis commented Mar 14, 2023

Question

There seems to be an icon attribute available in the social buttons, as explained in the documentation as: The SVG icon of the provider. But when entering a URL to an SVG file in that parameter, nothing changes, regardless of if the theme attribute is set or not. Is this feature meant for assigning custom icons?

@engram-design
Copy link
Member

This isn't to provide an arbitrary SVG to set an icon of your own. Instead, it returns the SVG icon for the provider you pick. For example, you might fetch a button:

{% set button = craft.socialShare.getButton('facebook') %}

{{ button.icon }}

This will output the Facebook SVG icon, and the same for any other provider.

I suppose what you're wanting to do is provide your own icons to use alongside those other providers. I'll see if that'll be something we can do, but it does go a little against what the plugin is for. But I'm sure there are cases where you'll want to show your social provider buttons alongside maybe some custom buttons as well - and keep everything consistent.

@daniellelecomte
Copy link

HI @engram-design - this is also something we'd like to be able to do - add a custom icon for FB, X, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants