Add a Twitter share link that validates

I found that my page wouldn’t validate at W3C Validator because of a Twitter button.

Here is a very easy way to make a Twitter button that does validate in Textpattern.

Make a form and paste in:

<p><a href="http://twitter.com/share?url=<txp:permlink />" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>

Then put:

<txp:output_form form="twitter" />

Wherever you want the button to appear.

The button opens a Tweet window with the page title and url already in place.

comments powered by Disqus