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

Custom buttons #187

Closed
TomK32 opened this issue Nov 17, 2017 · 7 comments
Closed

Custom buttons #187

TomK32 opened this issue Nov 17, 2017 · 7 comments

Comments

@TomK32
Copy link

TomK32 commented Nov 17, 2017

What's the best approach for a custom button that's not facebook, linkedin etc.?

There's only a few places like ShareButtonsService that have the buttons hardcoded and if those are replaced with something like registerButton then buttons with different actions would be possible.

I workaround by using the same tags and css classes, but that's of course not ideal.

@MurhafSousli
Copy link
Owner

MurhafSousli commented Nov 17, 2017

@TomK32 I didn't understand, what do you mean by

a custom button that's not facebook, linkedin etc.

What are you trying to accomplish? are you trying to add a custom button that is not for sharing?

@TomK32
Copy link
Author

TomK32 commented Nov 20, 2017

I just want to add another button for another social website that's not in the sharebuttons yet.

@FelixKre
Copy link

Hi. It would be nice If you could add a "Xing" share button. Its the largest german business network.

@MurhafSousli
Copy link
Owner

@TomK32 Currently buttons implementation is hard-coded, each button has its own class and parameters, do you have a dynamic design in mind?

@FelixKre
Copy link

Do you mean a specific theme like I can choose from the "lab" on the ngx share button page? Otherwise, I would prefer the standard one https://dev.xing.com/plugins/share_button

@MurhafSousli
Copy link
Owner

@FelixKre No, this is not related to themes, but It needs a pull request to add Xing button. or at least the sharer link information like the ones defined here

@MurhafSousli
Copy link
Owner

MurhafSousli commented Dec 17, 2017

@TomK32 In version 5 you can add custom share button, let's say add xing button

import { ShareButtons, noneOperator } from '@ngx-share/core';

  constructor(private share: ShareButtons) {
    this.share.registerButton('xing', {
      type: 'xing',
      text: 'Xing',
      icon: 'fa fa-xing',
      share: {
        desktop: 'sharerURLForXing',  // the sharer link used to share on xing
        android: 'sharerURLForXing',  // the sharer link used to share on xing
        ios: 'sharerURLForXing',      // the sharer link used to share on xing
        operators: [noneOperator]
      }
    });
  }

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

No branches or pull requests

3 participants