- Hits: 1563
- 0 Comments
- Subscribe to updates
- Bookmark
How to fix your broken 'Tweet This' Twitter links in K2 and Adsfactory (and anywhere you're trying to post a message to a Twitter status!)
Recently Twitter moved over to its Web Intents Platform which may well have passed you by - it certainly did me, until I had a few calls from clients saying that their 'Tweet This' links - particularly in K2 and AdsFactory in Joomla! but I assume this is the case in a huge range of web-based applications - had stopped working.
After a bit of digging, as it didn't appear to be reported many places, I came across this article on HighTechDad talking about the new system, and the changes we need to make to URL's to use it.What is the problem?
Basically the problem lies with the fact that the start of the URL path is generally hard-coded into systems, with the rest of the URL being dynamically generated based on what page you're browsing - so it automatically inserts the page title, URL and so forth preceeded by "I am currently reading ..." or something similar. As the URL has now changed, this needs to be updated. If you don't update it, your tweeters will just be dropped into their twitter homepage with no message in the status window ready to tweet (although you'll notice it appears in the URL).
Here is the old format for tweeting directly to a status message:
http://twitter.com/home?status=
Here is the new format for tweeting directly to a status message:
http://twitter.com/intent/tweet?text=
Clearly this requires some changes to be made:
K2
In K2, locate the file called view.html.php in components>com_k2>views>item
On line 220, change:
$item->twitterURL = 'http://twitter.com/home/?status='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
to:
$item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode('Reading @'.$params->get('twitterUsername').' '.$item->title.' '.$itemURLForTwitter);
AdsFactory
In Adsfactory you will need to edit the template that you're using - probably in the t_details_add_toolbar.tpl or t_add_details.tpl file. Just search for 'twitter' and replace the URL you find with the new string above.
Please leave a comment if you need help finding this in other components and I'll do my best to find it for you!

Leave your comment