ShrinkTheWeb Thumbnails

Last updated on
9 August 2017

The ShrinkTheWeb module at http://drupal.org/project/shrinktheweb allows caching and display of thumbnail images generated by the ShrinkTheWeb service at https://shrinktheweb.com.

On this page:

Installation
Configuration
Usage

Installation

  1. Register at https://shrinktheweb.com/user/register .
  2. Upload the module files on your site from http://drupal.org/project/shrinktheweb.
  3. Enable the ShrinkTheWeb module from admin/modules, section "Other".

Configuration

  1. Browse to your profile page at https://shrinktheweb.com and get the Access key and Secret keys for your profile.
  2. Browse to admin/config/media/shrinktheweb.
  3. Copy the Access key and the Secret key in the text fields.
  4. Configure the thumbnails folder where the cached images will be stored.
  5. You could configure the number of days the cached images are kept unchanged.
  6. You could configure additional ShrinkTheWeb API request parameters such as "Specific page captures", "Custom size captures" and others. Please note that some of the features only become available once you have upgraded to use them and save the settings page.

You could find more information by reading about How to use Website Screenshots.

Usage

Using Field Formatters

Starting with version 7.x-1.2, there is field formatter support for the Link module. You'll find the new formatters listed as format options on the 'Manage display' tab for all of your link fields when both modules are installed. For more details, read about content types and fields and how fields are displayed.

Sample usage for Drupal 7:

Use a field formatter or call the URL preview theme functions directly.

7.x-1.1 and earlier:

<?php
$url = 'http://shrinktheweb.com';
print theme_shrinktheweb_image($url);
?>

NOTE: It is now considered "bad practice" to use the theme() function in Drupal 7 also. Please consider using the instructions for Drupal 8 above.

7.x-1.2 and later:

<?php
$url = 'http://shrinktheweb.com';
print theme('shrinktheweb_image', array('url' => $url));
?>