{kun´ēzē}
5 1 1 1 1 1 Rating 100%
13Mar2019

Embedding a Twitter timeline on a Joomla website (without extensions)

Information
1483 hits Updated: 14 March 2019

How to embed a Twitter timeline on a Joomla website

How to limit the number of timeline entries displayed

There are many extensions that people can install that will add a Twitter timeline to their websites.  I don’t want to deprive struggling software developers of their profit but do we really need additional software (some of which costs money) in order to do something quite simple?  This article shows how to embed a Twitter timeline on a Joomla website without using any additional software.

The process is as easy as 1-2-3:  obtain the URL of the Twitter timeline; copy the URL into the Twitter publish site; copy the generated code into your website  It’s really that simple.

Step 1:  Obtain the URL of the Twitter feed

For the purposes of this guide, we will use the Twitter timeline @Joomla:  https://twitter.com/joomla.

Step 2:  Use the Twitter publish site

publishTwitterThe Twitter publish site is located at https://publish.twitter.com (see the image on the right; click to enlarge it).  Using the image as a guide, paste the URL of the selected Twitter timeline into the textbox (indicated by ① in the image).

Below the input box are two links:  click the Embedded Timeline link on the left as indicated by ②.  Clicking this link will cause the page to scroll down automatically, revealing the required HTML code.  Click the Copy Code button shown at ③.

The copied text is:

<a href="https://twitter.com/intent/tweet?button_hashtag=Joomla&ref_src=twsrc%5Etfw" class="twitter-hashtag-button" data-show-count="false">Tweet #Joomla</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Step 3:  Copy the code

The code, produced in step 2 above, can be pasted anywhere you would like. Perhaps the simplest way to implement an embedded Twitter timeline in a J! website is to create a module. Go to Extensions » Modules » New and then choose Custom.  Paste the copied text as raw HTML in the editor, give the module a title, assign the module to a template position and menu items, publish the module and save it.

To see an example of a custom module that displays an embedded Twitter timeline, go to https://www.kuneze.com/about.

But wait, there's more

The embedded Twitter timeline produced with the above instructions will show all “tweets”.  If you want to limit the number of timeline entries to, say, the latest four “tweets” you will need to modify the embed code by adding a data-tweet-limit tag, as follows:

<a href="https://twitter.com/intent/tweet?button_hashtag=Joomla&ref_src=twsrc%5Etfw" class="twitter-hashtag-button" data-show-count="false" data-tweet-limit="4">Tweet #Joomla</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

To see an example of a custom module that displays an embedded Twitter timeline (limited to the latest three “tweets”), go to https://www.kuneze.com/about.

About the author:

is a Joomla professional and former member of the Kunena project for more than 8 years—a substantial contributor to the original Kunena documentation project with over twenty thousand messages posted at the Kunena forum. The opinions expressed in this article are entirely those of the author. View his profile here.


Comments
# Margo 20-Jun-2019 11:35
May I simply just say what a relief to discover someone who genuinely understands what they are talking about on the web. You certainly know how to bring a problem to light and make it important. More people need to read this and understand this side of the story; you certainly possess the gift.

Comments are now closed for this entry

Trending now