Answer the question
In order to leave comments, you need to log in
How to set a separate template for content type in Drupal 8?
Hello.
I use Drupal 8. Actually, the question is for experts, who can explain to me in an accessible way how to get out of a difficult situation.
There is a content type, Lawyers & Attorneys, and there is a page.html.twig page template that I want to slightly modify and use for the Lawyers & Attorneys content type .
I know that you can use your own page template for nodes by changing the name from page.html.twig to page--node-node-number.html.twig
Yes, it works, but I won’t create a separate one for each page (node) template file, I have more than 200 pages with this type of material.
I read a couple of articles, but did not understand how to usehook_theme_suggestions_page_alter() , because with it, my problem can be solved.
How can I make the content type Lawyers and Attorneys use a separate page template? You need to use a template based on page.html.twig , not node.html.twig .
Please tell me how to solve this issue?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question