This project is not covered by Drupal’s security advisory policy.

Adds a [picsum] shortcode to the Shortcode module, so editors can drop random placeholder images from Lorem Picsum into any text format.

Usage

[picsum width="900" height="600" /]
[picsum width="400" height="400" grayscale="yes" blur="yes" /]
[picsum image="237" width="600" height="400" class="my-class" /]

Options

  • width / height: image size in pixels (default 900 × 600)
  • random: yes (default) or no. When yes, each shortcode gets a different image
  • image: a specific Picsum image ID (this turns off random)
  • grayscale: yes or no (default)
  • blur: yes or no (default)
  • class: extra CSS classes to add to the <img>

Versions

  • 3.0.x: Drupal ^11.1 || ^12 with Shortcode ^3.0
  • 2.0.x: Drupal ^9.3 || ^10 || ^11 with Shortcode ^2.0

Installation

  composer require drupal/picsum_shortcode
  drush en picsum_shortcode

Then enable the "Picsum" shortcode in your text format's settings (Configuration → Content authoring → Text formats and editors).

Upgrading from the 7.x Unsplash Shortcode

This module was previously the Unsplash Shortcode ([unsplash]), which used unsplash.it. That service now redirects to Lorem Picsum, so 2.0.x and later use Picsum directly.

  • The shortcode is now [picsum]; existing [unsplash] tags will not render.
  • The default CSS class is now picsum-image instead of unsplash-image.
  • gravity is no longer supported, because Picsum has no equivalent.
  • Picsum image IDs differ from the old unsplash.it image numbers.

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Project categories: Content editing experience
  • Ecosystem: Shortcode
  • Created by dieppon on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases