Extending the Twitter button

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

Extending the Twitter button

Postby Pieter » Tue Mar 15, 2011 9:46 am

Hello,

While visiting a website with a twitter button, after sharing the webpage via Twitter, I discovered the possibility to follow the accounts of the web page developers. Is it possible to extend the twitter button extension with this function?

Greets,

Pieter
Webdesigner, copywriter, translator and SEO specialist at www.write-it.nl
Pieter
 
Posts: 71
Joined: Mon Mar 23, 2009 6:53 pm
Location: Elspeet

Re: Extending the Twitter button

Postby Pieter » Fri Mar 18, 2011 8:51 am

Thanks for your reaction!
I found that Twitter is working with the 'data-related' key. By adding this to the code (see below), you will activate the function

Code: Select all
$html = "<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" " .
      "data-url=\"{$link}\" data-text=\"{$text}\" data-count=\"{$button}\"[b] data-related=\"Name - Input for generating relatings\"[/b] data-via=\"{$username}\">" .
      "{$label}</a><script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>";


However, I'm not able to add a function to the dashboard to manually enter the related accounts without browsing through the source code :)
Webdesigner, copywriter, translator and SEO specialist at www.write-it.nl
Pieter
 
Posts: 71
Joined: Mon Mar 23, 2009 6:53 pm
Location: Elspeet

Re: Extending the Twitter button

Postby Bob » Fri Mar 18, 2011 4:21 pm

The twitterbutton does this already, right?

Code: Select all
[[ twitterbutton text="Post on Twitter" link="http://example.org" username="example" ]]


The 'username' adds the 'via @bladibla' to the posted tweet..
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Extending the Twitter button

Postby Pieter » Fri Mar 18, 2011 4:30 pm

Not at all..
What I mean is this:

Image

The second screen is established by adding 'data-related:name, keywords' to the link..
Webdesigner, copywriter, translator and SEO specialist at www.write-it.nl
Pieter
 
Posts: 71
Joined: Mon Mar 23, 2009 6:53 pm
Location: Elspeet


Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 4 guests

cron