Statamic plugin for embedding public Tweets.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
twitter_embed
README.md

README.md

Statamic Twitter Embed Plugin

NOTE: This plugin is no longer under development. If it still has any value, please feel free to fork and take over.

This plugin allows you to quickly & easily embed public Twitter Tweets into Statamic-powered websites.

You can see it in action on my personal site, andreademers.com.

To learn more about Embedded Tweets, check out:

Installation

  1. Download the files, and copy the twitter_embed folder to the _add-ons directory.
  2. Make sure that the path is /_add-ons/twitter_embed.

Usage

Tag

{{ twitter_embed:tweet }}

Parameters

All parameters are optional except for id.

id (required)

Specifies the id of the Tweet to embed.

The id for Tweet https://twitter.com/ademers/status/376435741423063040 is 376435741423063040.

For example:

{{ twitter_embed:tweet id="376435741423063040" }}

maxwidth

Specifies the maximum width in pixels that the Embedded Tweet should be rendered at. It is constrained to be between 250 and 550 pixels.

For example:

{{ twitter_embed:tweet id="376435741423063040" maxwidth="400" }}

hide_media

Specifies whether to include images in the Embedded Tweet.

Set to true to hide.

For example:

{{ twitter_embed:tweet id="376435741423063040" hide_media="true" }}

hide_thread

Specifies whether to hide parent Tweet.

If the Embedded Tweet is a reply to another Tweet, set to true to hide the original (parent) Tweet.

For example:

{{ twitter_embed:tweet id="376435741423063040" hide_thread="true" }}

omit_script

Set to true to omit <script src="//platform.twitter.com/widgets.js" charset="utf-8"></script> from the Embedded Tweet HTML.

Only one of widgets.js needs to be included per page. Therefore, if you have multiple Embedded Tweets per page, it is best to omit it and manually add it to HTML just before the closing </body> tag as follows:

  <script src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</body>

For example:

{{ twitter_embed:tweet id="376435741423063040" omit_script="true" }}

align

Specifies the alignment of the Embedded Tweet.

Possible values: left, right, center. Alignment styles are not specified by default.

For example:

{{ twitter_embed:tweet id="376435741423063040" align="center" }}

lang

Specifies the language of the Follow button, Favorites count, Reply, Retweet, and Favorite links of the Embedded Tweet.

For example:

{{ twitter_embed:tweet id="376435741423063040" lang="fr" }}

To do

  • Add caching