Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

DCR Renderer

No security coverage Under active development 1 sites

This module allows you to fetch and display content from Drupal Content Repository URLs or local files within Drupal. It includes a Twig function and a Single Directory Component (SDC) for embedding content, with options for processing, asset handling, security, and caching.

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.

Drupal 11 · not 10

Ask your assistant about DCR Renderer

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • block Drupal core
  • node Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2025
Latest release
11 months ago
Releases (12 mo)
1
Maintenance
Slowing

Releases

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