Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
lsolesen CreditAttribution: lsolesen commentedComment #3
benjy CreditAttribution: benjy at PreviousNext commentedYou 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?
Comment #4
benjy CreditAttribution: benjy at PreviousNext commentedClosing this for now unless you have more to add.