Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Summary

Provide Twitter cards meta tags on nodes to allow previews of the nodes to be shown in tweets giving users a preview of the media you are linking to.

The main aim of the module is to do this while not being dependent on any other modules.

Features

There are 3 different types of cards Summary, Photo and Video. This module supports Summary and Photo. Video however is not supported due to the complexity of the integration this would not be possible to create a generic solution. You would need to do this project by project.

The following can be done per content type.

  • Use the Summary or Photo card style
  • Select an image field, from that content type, to use in the tweet

Testing

Once you have the module enabled you can use the following tool provided by Twitter to preview how your content will look in Twitter cards, without the need to tweet links to your pages.

Testing your own Twitter cards

You can use the following link to test integration of Twitter cards on your own site without having to spam your twitter account.

https://dev.twitter.com/docs/cards/preview

Note: I have found the Twitter dev preview of cards to be a little bit temperamental, I am guessing because its in development so it may not always work.

Related modules

This module does not use the Twitter API in anyway to list tweets or send tweets. If you want to list tweets on your site or post straight to Twitter then look at either of these modules;

@nico059 has also started a sandbox here which serves the same purpose but goes about it in a different approach as it is an add-on for the metatag module

Project information