question regarding parameters for iframe version of Twitter button

1,695 views
Skip to first unread message

SD admin

unread,
Jan 2, 2011, 7:52:51 PM1/2/11
to Twitter Development Talk
Hello all,

I had a question that is probably very simple, but for some reason I'm
missing something.

I was trying to implement Twitter and Facebook buttons on my site
presented on the same line. I have seen other do this, some using ul
list overflows and other tricks, but I didn't like them. The issue was
that the Facebook button uses an iframe, and the standard Twitter
button did not. Putting them in a table did little to solve the issue.

Anyway, I saw that the Twitter button is available in an iframe
version as well, I've used it and it works great. There are a few
issues however.

On the Tweet button dev page [http://dev.twitter.com/pages/
tweet_button], it shows that you can use an iframe, but says "When
using this method you have to use query string parameters to customise
the Tweet Button’s behavior."

The iframe code presented is:

<iframe allowtransparency="true" frameborder="0" scrolling="no"
src="http://platform.twitter.com/widgets/tweet_button.html"
style="width:130px; height:50px;"></iframe>

And these are the parameters:

url URL of the page to share
via Screen name of the user to attribute the Tweet to
text Default Tweet text
related Related accounts
count Count box position
lang The language for the Tweet Button
counturl The URL to which your shared URL resolves to

Typically one would just put the parameters after http://twitter.com/share,
but I am unsure where to do this with the iframe version???

Can someone point me in the right direction please?

Thanks

Matt Harris

unread,
Jan 3, 2011, 7:10:41 PM1/3/11
to twitter-deve...@googlegroups.com
Hey,

When supplying Tweet Button arguments to the iframe version you should add them as querystring arguments of the iframe URL.
In the iframe example below the count will be the vertical style, and the shared URL will be http://dev.twitter.com/pages/tweet_button

<iframe allowtransparency="true" frameborder="0" scrolling="no"
            style="width:60px; height:65px;"></iframe>

Hope that helps,
@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris



--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: http://groups.google.com/group/twitter-development-talk

Reply all
Reply to author
Forward
0 new messages