Tweet Button

By bcammobcammo

Description

This snippet will add the official Twitter tweet button to your wikidot page. This allows visitors to tweet about the page they are on by displaying a popup window, meaning they don't need to leave your site.

Attributes

The snippet uses the following attributes, most of which are required for the button to work properly.
Attribute Required Allowed values Default value Description
url yes any valid URL, including %%link%% The URL of the page you want to share.
text yes any text The text that people will include in their Tweet when they share from your website.
via yes any twitter username The username you want @-mentioned in the tweet (probably your own).
count yes vertical, horizontal, none Controls the display of the tweet count.
align no left, right, center left Sets the horizontal positioning of the button.

Please note: the float variable has been changed to align, as it better describes the function of the property. Please adjust your includes accordingly.

Code

You can add the tweet button to your page with the following code:

[[include :snippets:tweet-button
|url=http://example.com
|text=Check out this awesome page on @wikidot
|via=twitter-username
|count=vertical
]]

You can also use the button in a live template. Such a use might use the code below.
[[include :snippets:tweet-button
|url=%%link%%
|text=%%title%%
|via=twitter-username
|count=horizontal
]]

In action

See the button below for a real-life working solution. Go on, you know you want to press that button…


Thanks to tsangk for this great snippet: conditional-blocks


text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]



Other snippets posted by bcammo

Chatbox - 26 Mar 2012 11:07
Google +1 Button - 19 Mar 2012 19:40


Rate this solution

If you think this solution is useful — rate it up!

rating: +11+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License