How to use a different node template for the PDF view mode ?

Created on 10 July 2020, about 5 years ago
Updated 20 June 2025, about 1 month ago

Hello !
I'm trying to theme the PDF generated page, with a different layout than the node page.
i tried :
node--attestation-test--view-mode-pdf.html.twig
node--attestation-test--pdf.html.twig

This template : node--attestation-test.html.twig affects both node , and pdf.

Also, when i change the order in the display mode, it doesn't seem to affect the pdf generated page, it is still the same order as my node page.

💬 Support request
Status

Closed: works as designed

Version

2.1

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024