- 🇬🇧United Kingdom David Fiaty
"Entity PDF allows you to chose a view mode" => How to select a view mode to be rendered as PDF?
- 🇬🇧United Kingdom matt b
Just in case anyone comes across this... all you really seem to have in the htmlpdf.html.twig template is the {{ title }} and {{ content }} variables - I guess because we're dealing with the rendered PDF, not with theming entity.
However, it is possible to do more with the twig_tweak module → . With this I can get the node ID and then render a specific field from that node. It's probably not the best way... but it gets the job done.
{% set nid=drupal_token('current-page:url:args:value:2')%} <p>{{ drupal_field('field_author', 'node', nid) }}</p>