Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Partial Page Print

39 sites Security covered Drupal 9–11
View on drupal.org

This module adds a button allowing visitors to print only specific parts of a web page. The printed output will retain the site's theme but exclude unwanted page elements.

Add a button to your page to allow visitors to print part of the current page.

The printed page would use the same theme but without any of the regions, blocks, or other parts of the page that are not desired on the printed page.

Requirements

This module requires no modules outside of Drupal core.

Installation

Install with composer: composer require drupal/partial_page_print then enable the module.

Using

To add the print button to a page, add the following element to the render array in your custom module or with a preprocess hook in your theme. Be sure that the #element_id is populated with the HTML ID of the thing you want to be printed on the page.

 $build['print_link'] = [
   '#value' => $this->t('Print the Content'),
   '#type' => 'partial_page_print_button',
   '#element_id' => 'my_div_id',
 ];

Example

Example of adding the partial page print button to a node template in your site's theme:

In your theme's .theme file:

function function MYTHEME_preprocess_node(&$variables) {
 $variables['nodeSummaryPrintButton'] = [
   '#value' => $this->t('Print Summary'),
   '#type' => 'partial_page_print_button',
   '#element_id' => 'node-summary',
 ];
}

In your theme's node template:

<article>
  {# ... #}
  {{ nodeSummaryPrintButton }}
  <div>
    {# Node summary here #}
  </div>
  {# ... #}
</article>

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jul 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
1.2.0 Stable 9–11 Jul 10, 2025