Implementing our Node template
Creating a node template is not foreign to us; our process begins the same way we would create any Twig template. We begin by inspecting the markup of our page to identify which template is currently being used and the various file name suggestions available to us. Since our Post Listing block is referencing the listing view mode of our post content type, we can create a new Twig template called node--post--listing.html.twig.
Begin by grabbing a copy of the node.html.twig template from core/modules/node/templates and placing it into our themes/octo/templates folder. We will then rename the file to node--post--listing.html.twig so that we only affect the markup for this particular content types display. Next, we will ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access