Drupal 8/9 how to add suggestions of page templates for content types
In Drupal 8 and Drupal 9 add suggestions of page templates for the different content types by using the hook_theme_suggestions_page_alter() function in .theme file.
For example, if you want to create page template for specific content type like page--[content-type].html.twig. For article content type naming convention will be page--article.html.twig, the Basic page content type naming convention will be page--page.html.twig and the car content type naming convention will be page--car.html.twig.
For example, if you want to create page template for specific content type like page--[content-type].html.twig. For article content type naming convention will be page--article.html.twig, the Basic page content type naming convention will be page--page.html.twig and the car content type naming convention will be page--car.html.twig.
Share
share your add link
https%3A%2F%2Fmycode.blog%2Flakshmi%2Fdrupal-89-how-add-suggestions-page-templates-content-types%0A
Share in social
Comments