How do you in D8 create specific templates for specific view modes. E.g. I have a workout content type, and I want to be able to print that content type in a couple of different ways:

- Like this: https://github.com/motionsplan/motionsplan-pdf-library/blob/programs/src...
- More simple like this http://motionsplan.dk/node/432/pdf-compact

And I probably want to add more later on. How is this achieved by entity print?

Comments

lsolesen created an issue. See original summary.

lsolesen’s picture

Issue summary: View changes
benjy’s picture

Status: Active » Needs review
Related issues: +#2702579: Allow additional options for PhpWkhtmlToPdf

You should be able to copy templates/entity-print.html.twig to your theme under templates/entity-print--workout.html.twig ?

Let me know if you get it working and we can add it to the docs here: https://www.drupal.org/node/2706755

I should also point out that the template doesn't do much other than print the node, maybe you'd be better off overriding the template for the node in the same way?

benjy’s picture

Status: Needs review » Closed (works as designed)

Closing this for now unless you have more to add.