pinterest_widget
The Pinterest Widget module provides a robust, secure integration between Drupal and Pinterest. It empowers site owners to increase content discoverability by allowing users to save images directly to their boards. Beyond a simple "Save" button, this module enables you to embed rich Pinterest content—including Pins, Boards, Profiles, and Follow buttons—using Drupal’s native Block and Field systems.
Features
- Save Button on Hover: Automatically displays the Pinterest "Save" button when users hover over images on enabled content types.
- Field System Integration: Provides custom Field Types, Widgets, and Formatters for Pin, Follow, Board, and Profile content.
- Configurable Blocks: Four distinct block types (Pin, Board, Profile, Follow) with support for fixed presets like Square, Sidebar, or Header.
- Flexible Customization: Full control over button size, shape, and language selection to match your site's branding.
- Responsive Design: Supports both fixed dimensions and fully custom layouts for embedded widgets.
- Security Focused: Includes a dedicated validator to sanitize Pinterest URLs and prevent malformed data or injection attacks.
Installation
It is recommended to install the module via Composer to manage dependencies automatically. See Installing Drupal Modules for more details.
composer require 'drupal/pinterest_widget'Enable the module using Drush:
drush en pinterest_widgetConfiguration & Usage
After installation, navigate to Configuration » Services » Pinterest Widget (/admin/config/services/pinterest-widget) to manage global settings.
- Global Styles: Define default button styles (Regular, Round, Large) and localization.
- Scope: Select which Content Types should activate the image hover "Save" button.
- Using Blocks: Go to Structure » Block layout to place Pinterest widgets in any region.
- Using Fields: Add a Pinterest field type to any entity to allow editors to embed specific Pins or Boards per node.
Requirements
This module is designed for modern Drupal environments and requires:
- Drupal Core: 10.x or 11.x
- PHP: 8.1 or higher
Support & Contributions
If you encounter bugs or have feature requests, please post them to the Pinterest Widget issue queue. For community-based assistance, you can also check Drupal Answers.