Need example of custom templating in views

Created on 9 April 2019, over 5 years ago
Updated 20 January 2023, almost 2 years ago

Hi all,
i can't get how to print a customized pdf outputted by a views print display.

Situation:

- library dompdf/dompdf
- i have a view of submitted webforms (view name : pdf_webform )
- this view has 2 displays : the first is a page display, the second is a print display (id: entity_print_views_print_1)

- when viewing the first page (passing submission id as contextual filter i correctly obtain the link to download the pdf)
- the pdf is showing correct values

BUT.. i must add some custom logic and presentation to the printed pdf.

I suppose it should be possible to add a custom twig template to the print display of the view, but i'm clueless about this.

I tried to add a custom template in the current theme folder, precisely in :
sites/all/themes/bootstrap_barrio/templates/views/views-view--pdf_webform--entity_print_views_print_1.html.twig

If all this makes sense.. I'd like to figure out if this is the correct position ( i must admit that i obtain a blank pdf page, instead of the default one ).
Also i'd like to be advised about a good starting twig template to generate the views rows for pdf printing.

💬 Support request
Status

Active

Version

2.1

Component

Documentation

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.

No activities found.

Production build 0.71.5 2024