Twitter for Moodle

From K-Wiki

Jump to: navigation, search

You can add an HTML block to your course to display your Twitter profile, or lists, searches, or favorites.

Contents

Steps to add Twitter in Moodle

  1. Go to your Moodle course > Turn editing on
  2. Add an HTML block to your course from the Add blocks menu
  3. Go to the widgets page on Twitter > Create New
  4. Follow the steps there to customize the settings, preferences, appearance and dimensions of your twitter widget.
  5. When you are satisfied with the way it looks, click the "Create Widget" button
  6. Copy the embed code that Twitter generates for you
  7. Go back to your Moodle HTML block that you've created in Step 1 > Click on the gear icon Gear icon.png > Configure (new HTML block) block
  8. Give the block a title and expand the 'Content' menu Togglebar Toggle.png
  9. Click on 'Edit HTML Source' button Edit HTML Source.png
  10. Paste the code from step 6 into here > Click 'Update'
  11. Save changes

Troubleshoot

  • You will only see a link to the Twitter feed while you're still in the editor. The feed will appear after you save the HTML block and go back to the course home page view.
  • You can also add a Twitter feed to the body of your course as a Label. (We don't recommend doing this. A Twitter feed takes up a lot of vertical space.)
  • If you *still* see just a link to the Twitter feed while in the course home page view, you may have to turn off the HTML tidy filter.
  • Add the widget code to either a Moodle Label (for display in the main body of the course) or an HTML Block (for display in the Blocks column). In the editor, choose the HTML view and paste the widget code. You won't see the widget in the editor, only after you've saved the Label or HTML block and view it on the course homepage layout.

Sample Code

A sample of widget code (searches for #sockmonkey)

<a class="twitter-timeline" href="https://twitter.com/search?q=%23sockmonkey" data-widget-id="316249092839849984">Tweets about "#sockmonkey"</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Resources

See also:

Personal tools