ScreenshotNeo

BlogHow-to

How to Add ShrinkTheWeb Screenshots to a Website Thumbnail Workflow

A dated Drupal 8 guide shows how ShrinkTheWeb screenshots were configured and cached as thumbnails. Follow the historical workflow carefully and verify current module and service support first.

By the ScreenshotNeo team4 October 20268 min read

Direct answer: A Drupal 8 guide last updated on 4 March 2019 documents this workflow: register with ShrinkTheWeb, retrieve access and secret keys, configure the Drupal module and its thumbnail cache, then render screenshots with a field formatter or a theme render array. Treat the instructions and code below as historical. Drupal.org marked the ShrinkTheWeb module as apparently unsupported as of 31 January 2022; that notice concerns the Drupal module and does not establish whether the ShrinkTheWeb service itself is currently available. Before using this integration on a live site, verify the current service API, module compatibility, authentication, and terms with their owners. Drupal’s setup and usage guide · Drupal module project status.

1. Check whether this historical integration fits

The documented steps are specifically for Drupal 8 and the ShrinkTheWeb module. The guide recommends field formatters for routine use and provides PHP render-array examples for per-screenshot options. It does not confirm support for current Drupal releases or a current ShrinkTheWeb API contract.

  • Identify your Drupal core version and check whether the module has a compatible, maintained release.
  • Confirm directly with ShrinkTheWeb that the service is operating and that the credentials and parameters you intend to use are still accepted.
  • Test in a non-production environment before routing thumbnail traffic through an old integration.

The dated Drupal project notice is evidence about the project’s support status at that time, not evidence that the vendor service has shut down. A separate Drupal screenshot project also reports no supported stable releases; it is not current vendor documentation. Drupal’s separate Website Screenshot project page.

2. Historical Drupal setup sequence

  1. Register for a ShrinkTheWeb account, if the service currently permits registration.
  2. Retrieve the account’s access key and secret key, if those credentials are still used.
  3. Install and enable a compatible version of the Drupal module. The old guide references the module project page and Drupal’s administrative module screen.
  4. Open the module settings page. The Drupal 8 guide gives the path admin/config/media/shrinktheweb.
  5. Enter the keys, choose the directory where thumbnail files are cached, and set how many days cached images remain unchanged.
  6. Set any optional capture parameters only after confirming their current names and semantics with the service documentation.
  7. Use a field formatter for ordinary field display. Reserve custom render arrays for cases that need individual capture settings.

The guide says global settings apply to screenshots rendered through field formatters and its basic example. Its advanced example passes options per request. That division is useful when designing a thumbnail workflow, but the old module’s behavior must be verified against the version you actually run.

3. Configure thumbnail freshness and storage

The historical module settings include a thumbnail cache directory and a cache duration in days. These settings control where Drupal keeps generated thumbnails and how long it can reuse an unchanged cached image before refreshing it. The guide does not establish a current cache invalidation contract for ShrinkTheWeb, so confirm how a refresh is triggered before relying on a particular age limit.

  • Choose a writable cache location: ensure the Drupal process can create and update files there, and account for storage growth.
  • Set an appropriate freshness window: a longer window reduces repeat capture work but leaves thumbnails stale for longer; a shorter window can increase refresh traffic.
  • Plan for refreshes: the Drupal project page mentions historical “Refresh ALL” functionality. Do not assume it exists or works in your installed version without checking.
  • Keep the cache disposable: retain the source page URL and capture settings with the content so thumbnails can be regenerated if cache files are lost.

For large catalogs, avoid refreshing every URL simultaneously unless the currently supported service and module document that usage. A staged refresh reduces the chance that a cache refresh creates a burst of outbound requests.

4. Render thumbnails in Drupal

The documented basic path is a field formatter configured through Drupal’s UI. The guide also shows a Drupal 8 render-array example for advanced usage. The code here reproduces that historical pattern; it is not a claim of compatibility with current Drupal APIs or module releases.

Basic historical render-array example

<?php
$url = 'https://example.com';
$thumbnail = array(
  '#theme' => 'shrinktheweb_image',
  '#url' => $url,
);
print drupal_render($thumbnail);
?>

This uses global settings configured in the module. In production, use the field formatter where it meets the need, and escape or validate URLs according to your content model and Drupal version.

Per-request historical options

<?php
$url = 'https://example.com/article';
$thumbnail = array(
  '#theme' => 'shrinktheweb_image',
  '#url' => $url,
  '#custom_width' => 600,
  '#full_length' => true,
  '#max_height' => 320,
  '#native_resolution' => 1020,
  '#widescreen_resolution_y' => 760,
  '#delay' => 5,
  '#quality' => 90,
);
print drupal_render($thumbnail);
?>

These are the parameter names and example values recorded in the Drupal guide, not verified current ShrinkTheWeb settings. Some options were described as requiring account upgrades. Confirm availability and billing with the service before deploying them.

5. Historical capture options at a glance

Option in the guide Documented purpose Workflow consideration
custom_width Set a custom screenshot width. Match the thumbnail slot and avoid downloading needlessly large images.
full_length Request a full-length screenshot. Long pages may create tall images that need a crop or a separate display treatment.
max_height Crop or cap image height. Useful for uniform cards; check what content is cut off.
native_resolution Set browser resolution or viewport width. Viewport dimensions affect responsive layouts and can differ from output image width.
widescreen_resolution_y Set browser resolution or viewport height. Pair with the intended viewport width and verify the resulting composition.
delay Wait a number of seconds after page load. Can help pages that render content late, while increasing capture time.
quality Set image quality from 1 to 100. Balance file size and visual detail; the guide does not establish a current encoding or quality contract.

The guide also notes that without an “Inside Pages” upgrade, a URL may produce a homepage screenshot only. Treat this as historical account behavior and verify current service restrictions. Global settings affect all basic/formatter captures; request-specific settings in the advanced example override the defaults for that particular render, according to the guide.

6. Design the thumbnail workflow

  1. Store the target URL. Keep it as content data instead of deriving it from an untrusted request parameter.
  2. Choose a consistent image shape. Define target width, viewport, and crop rules to suit the card layout.
  3. Render with Drupal integration. Prefer a supported field formatter for repeated editorial fields; use per-request options only when pages need different capture behavior.
  4. Cache generated images. Set the cache directory and freshness duration after checking current module behavior and service limits.
  5. Handle missing previews. Design a placeholder or retry path for unavailable pages, timeouts, and failed captures; the historical sources do not specify modern failure response behavior.
  6. Refresh deliberately. Refresh on content changes or an appropriate schedule if supported, and avoid unnecessary recapture of unchanged URLs.
  7. Monitor the result. Check cache growth, failed thumbnails, stale images, and page rendering latency.

7. Troubleshooting

Symptom Likely cause What to check
Module cannot be installed or enabled The historical module may not support your Drupal core version, or dependencies may be missing. Check the module’s current release and compatibility information. Do not force an old Drupal 8 module into a newer site.
Authentication fails Keys may be wrong, disabled, or no longer accepted by the service. Recheck credentials in the vendor account and current API documentation. The old guide describes access and secret keys only as historical instructions.
No thumbnail appears Cache directory permissions, an invalid URL, a failed service request, or an incompatible theme hook may be responsible. Check Drupal logs, URL validity, writable storage, module compatibility, and vendor-side response details.
The homepage appears instead of an inner page The old guide says inside-page capture depended on an account upgrade. Verify current account capabilities and URL capture rules with the service.
Thumbnail has the wrong size or crop Global settings may be applied, a per-request option may be ignored, or viewport and output dimensions may be confused. Inspect the effective formatter/global settings and test one capture with the currently documented parameters.
Content is missing from a screenshot The page may render after capture, or the historical delay option may not behave as expected now. Check current wait/rendering options and test representative pages. The guide documents a delay after page load but does not establish current semantics.
Old previews persist after a source page changes The cached thumbnail may still be within its configured lifetime. Check the cache duration and current refresh mechanism; the Drupal project page historically mentions a refresh-all feature.
Storage fills up Cached images accumulate or are not being expired as expected. Inspect the configured cache directory, retention behavior, and site storage monitoring.

8. Performance, reliability, and cost

Performance: Reusing cached thumbnails avoids repeating screenshot work on every page view. Full-length captures, extra render delay, and frequent cache refreshes can make thumbnail generation slower or more resource intensive. Test with pages representative of the real content rather than assuming one setting suits every URL.

Reliability: The browser capture depends on the destination page, network, service, and Drupal integration. Keep rendering resilient: show a placeholder when a preview is missing, record failures, and make refreshes recoverable. The research sources do not establish current uptime, retry behavior, or service response codes.

Cost: The cited Drupal pages do not verify current ShrinkTheWeb pricing, service availability, or account limits. The old guide says some capabilities required an account upgrade; check current vendor terms before using paid features or estimating costs. No affiliate or referral terms are established by these sources.

9. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its one-call API can return a screenshot or PDF, and its documented features include full-page capture, selector capture, viewport presets, custom wait conditions, and caching. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000 screenshots. Sign up for free and get 1,000 screenshots a month with no card.

10. FAQ

Does the Drupal module status mean ShrinkTheWeb has shut down?

No. The dated Drupal.org notice describes the module project’s support status, not the current status of the ShrinkTheWeb service.

Should I use this code on Drupal 10 or 11?

Do not assume compatibility. The cited examples are from a Drupal 8 guide last updated in 2019. Confirm a maintained release and supported Drupal version before installation.

Are the listed capture options guaranteed to work today?

No. They are historical parameters from the Drupal guide. Check the service’s current first-party documentation and account terms.

Can this workflow be used for any URL?

The guide says to supply a URL, but it does not establish current restrictions or guarantees for arbitrary destinations. Verify the current service rules and validate URLs in your application.

Where should ordinary thumbnails be configured?

The historical Drupal guide recommends field formatters for basic usage and render-array options for advanced per-request customization.