Twitter-share-button does not work for URL with parameters


#1

I am using the following code created by the tweet button creator:

<a href=“https://twitter.com/share” class=“twitter-share-button”{count} data-text=“Check out this VMAR webpage” data-via=“VineyardMAR”>tweet

This tweet button is supposed to tweet the current URL and it does if there are no parameters included in the URL

The problem is that the URL is included in the tweet if there are now parameters include in the URL. For instance is the URL is http://www.vmarchurches.com/search.php, the URL is included in the tweet. If the URL is http://www.vmarchurches.com/search.php?cat=Regional Conference , not URL is included in the tweet.

If the URL is http://www.vmarchurches.com/search.php?cat=Regional Conference and I mouseover the tweet button, I can see some of the ?cat=Regional Conference but it is no included in the tweet. Is the URL too long?

Please help me.


#2

You should URL encode parameters.

Becomes:
https://twitter.com/intent/tweet?url=https%3A%2F%2Fexample.com%2F%3Ffoo%3Dbar&text=Hello%20world


#3