Hello,

I think it would ne really useful to have the twitter username display as a follow button.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

opi’s picture

Nice idea !! I think the best could be a new formatter, don't you think so ?

Anyone, feel free to submit a patch !!

frob’s picture

Easy enough.

For reference this is the twitter api doc page about this.
https://dev.twitter.com/docs/follow-button

I realize now that I have made this patch against the current release.

frob’s picture

Status: Active » Needs review

wow quick response. ;)

opi’s picture

Status: Needs review » Needs work

and quick patch too !!

Few things about your patch:
- Why not returning a render array, with '#theme' => 'link'
- With render array, we could add the js with #attached
- Instead of returning empty arguments like 'data-width', we could add formatter settings for these.
- 'data-lang' may use global $language (I care about i18n ;)

Btw, thanks for bringing up this idea, I try to work on this on the next days.

frob’s picture

I thought about that, but this way was quicker and I need the functionality. Maybe later today I will add the settings to the array.

I will assign it to myself when I start back up on it.

frob’s picture

Assigned: Unassigned » frob

Lets see about this.

frob’s picture

Still working on this. I have it using the render array. Now all that is left is to make it use settings. I should have for that tomorrow.

Leaving it assigned to me for now.

frob’s picture

Status: Needs work » Needs review
FileSize
7.04 KB

Hows about this one.

frob’s picture

Assigned: frob » Unassigned

any chance of this getting reviewed.

opi’s picture

(sorry for the lag)

I rewamp the patch for several reasons:
- place the button markup into a theme function
- add some condition for summary & form (prevent warning when not using the button formatter)

Please test this patch, and I'll add it to the dev version

opi’s picture

Issue summary: View changes

@frob : 2 years after, have you tested this patch ? ;)

I'll try to show some love to this module in the next weeks, and the "follow button" can be a part of the next stable release.

frob’s picture

Nope, I have not. Does it still apply.

Honestly, I don't work with many news sites anymore and I haven't used this in quite a while.

opi’s picture

Thanks for your quick answer. I'll test it soon, and ship it with the next stable release, hopefully.
Thanks for bootstrapping this feature !

  • opi committed 10404ae on authored by frob
    #1988730 Add display as follow button.
    
opi’s picture

Status: Needs review » Closed (fixed)

Applied and commited to 7.x-1.5.
Thanks for your work.