I’ve recently been asked about embedding a Twitter feed in Moodle.
You may already have links in your courses to relevant Twitter accounts but embedding a feed directly on the course page can help to engage learners. Amongst other benefits, it can connect your course to the real world promoting the relevance of the learning as well as keeping your content fresh without you having do anything!
The best way of presenting a Twitter feed in your course is to use the HTML block which then sits on the right-hand side of the course, independent of the more specific learning content in the main sections.
To add a Twitter feed:
- Go to your course and Turn editing on in order to Add a new block from the bottom of the ‘Navigation drawer’ on the left-hand side.
- Once you’ve added the HTML block, locate your (new HTML block) in the blocks on the right-hand side, and click on the ‘gear’ icon to ‘Configure’.
- You can give the block a name if you wish (“Twitter”, for example) and then you need to click on the Show/hide advanced buttons in the Content’ field’s editor (1, in the image below) and then click on the HTML icon (2).
- You then need to replace the existing code in the content area with the following code:
<a class="twitter-timeline" href="https://twitter.com/oxfordbrookes" data-tweet-limit="5"> Tweets by @oxfordbrookes </a> https://platform.twitter.com/widgets.js
- You’ll then need to change the URL (1, below) in the code to link to the Twitter account that you wish to embed in the course. You’ll also need to change the text* (2, below) to something more suitable:
*the text “Tweets by @oxfordbrookes” will only show if, for any reason, the twitter feed can’t be displayed
- Scroll down and click on Save changes to return to your course page. Your twitter feed should now be displayed in a block on the right-hand side.