Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi KK
Just having an issue with using a tweet button on a CouchCMS blog.

The tweet button works, but it only picks up the domain name, not the full url to the article.

Any ideas?

Example is here:
http://www.vintessential.com.au/articles.php?p=25

thanks

@webecho
Hi webecho, nice website. I believe you need to make use of twitter's specified data-url parameter. The documentation is here by the way: https://dev.twitter.com/docs/tweet-button.

Current Code
Code: Select all
<a onClick="_gaq.push(['_trackEvent', 'Twitter', 'Tweet', 'Footer']);" href="https://twitter.com/share" class="twitter-share-button" data-hashtags="winemaking">Tweet</a>

Fixed Code?
Code: Select all
<a onClick="_gaq.push(['_trackEvent', 'Twitter', 'Tweet', 'Footer']);" href="https://twitter.com/share" class="twitter-share-button" data-url="<cms:show k_page_link />" data-hashtags="winemaking">Tweet</a>
@webecho
Strangely, placing the exact code you have in your page on my test site works perfectly :)
So, for some reason, Twitter's JavaScript code fails to recognize the current page's URL on your setup.
I agree with @cheesypoof that in this case, we can lend it a helping hand by specifying the URL ourselves the way he showed.

Let us know if it helps.
Thanks
Thanks cheesypoof.
I'll give that a try.
Glad you like the site too :)

KK - yeah, I've tried it on a couple of others on my localhost server and it works correctly.
When you hover over the link it shows the referrer url as the individual page, but the displayed url is just the domain.

Will try it in the morning and post the results here - hopefully it will do the trick

Thanks guys, appreciate the help.

@webecho
Thanks Cheesypoof - it worked perfectly.
Next fix is getting the SEO friendly URL's working - will start a separate thread though KK

thanks guys

@webecho
5 posts Page 1 of 1

Who is online

In total there are 17 users online :: 0 registered, 0 hidden and 17 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 17 guests

cron