Drupal is a registered trademark of Dries Buytaert

dcr_renderer

2 sites No security coverage
View on drupal.org

The DCR Renderer module provides a Twig extension and Single Directory Component (SDC) for fetching and rendering content from Drupal Content Repository URLs or local file paths. It has multiple processing options for proxying urls and assets.

It works hand in hand with the Drupal Content Repository module which makes URLs available for Drupal Entity which can be used to embed the entity in a Single Directory Component (SDC). The Drupal Content Repository it draws from can be on a remote Drupal server or on the same server.

Features

  • Twig Extension: dcr_get_contents() function for fetching and processing remote/local content
  • SDC Component: dcr-render component for embedding content with fallback options
  • Multiple Processing Types: Raw, proxied, hardened, and full processing options
  • Asset Extraction: Automatically handles CSS and JavaScript from fetched content
  • Security Controls: Domain restrictions, file extension filtering, and content sanitization
  • Caching: Configurable caching for improved performance
  • Error Handling: Graceful fallbacks when content cannot be fetched

Post-Installation

You install the module and you can then use its built in SDC Component
DCR Renderer in Drupal Canvas or a twig template in order to see it.

Usage

In Drupal Canvas

  1. Click Edit if you are not in the Canvas Editor
  2. Click the + Look in the left column under DCR Renderer.
  3. Drag the DCR Renderer component onto your page.
  4. In the Properties editor on the right.
  5. Set the Content URL to the Drupal Content Repository URL or other URL.
  6. Set the Processing Type property if there are issues like broken links or invisible images.
  7. You should see the referenced content in the Drupal Canvas.

In a Twig Template

{# Basic usage - fetches and processes with default 'hardened' mode #} {{ dcr_get_contents('https://example.com/repository/node/123') }}

{# With specific processing type #}
{{ dcr_get_contents('https://example.com/repository/node/123', 'proxied') }}

{# Local file #}
{{ dcr_get_contents('public://dcr-content/page.html', 'hardened') }}

The Drupal Content Repository module makes any Drupal Entity available with a URL or path and able to be embedded in a Single Directory Component (SDC). The Drupal Content Repository it draws from can be on a remote Drupal server or on the same server.

Related projects

The Static Content Type module makes static, React, Angular or Vue content embeddable in Single Directory Components (SDC) or Paragraphs, Nodes or Blocks. While the DCR Renderer is for Live Content From Drupal or elsewhere.

Activity

Total releases
2
First release
Aug 2025
Latest release
4 months ago
Release cadence
62 days
Stability
50% stable

Releases

Version Type Release date
1.0.0 Stable Oct 18, 2025
1.0.0-beta1 Pre-release Aug 17, 2025