Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.


Easily display tweets filtered by Twitter handle, timeline, or search term in a Drupal block. You can control how many tweets should display and whether to include replies or retweets.

A single set of Twitter app credentials is used site-wide, but each block instance can display different tweets with different display settings.

This module uses the application only (read-only access to public information) via the Twitter API.

By design, theming is minimal. Developers are expected to customize the display via their chosen theme.

Configuration

  1. You first need a Twitter App. Sign in to Twitter and go to https://apps.twitter.com/ . Copy the "key" and "secret" associated with your new app.
  2. After installing the module in Drupal, go to Configuration > Media > Twitter Widgets (admin/config/media/twitter_profile_widget). Enter the Twitter App key and secret you created in step 1.
  3. Go to Admin > Structure > Block Layout > Custom Block Library > Add custom block (/block/add) and create one or more widgets.

Staying secure

Your Twitter app consumer key and consumer secret will be stored in a Drupal configuration entity. If using version control and configuration management, use a tool such as config_ignore and config_exclude to prevent exposing your Twitter app credentials, or a Drupal core solution such as $settings['config_exclude_modules'].

For non-UI management & deployment across environments, consider referencing these credentials through the filesystem, either through reference via settings.php or the equivalent:

$path = 'sites/default/files/private/twitter.json';
if (file_exists($path)) {
  $json_text = file_get_contents('sites/default/files/private/twitter.json');
  $twitter_widget = json_decode($json_text, TRUE);
  $config['twitter_profile_widget.settings']['twitter_widget_key'] = $twitter_widget['twitter_widget_key'];
  $config['twitter_profile_widget.settings']['twitter_widget_secret'] = $twitter_widget['twitter_widget_secret'];
}

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Feb 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
3.1.3 Stable Mar 9, 2023
3.x-dev Dev Mar 9, 2023
3.1.2 Stable Feb 6, 2023