I want to customize how some of my content types display. Where do I do this at in Drupal 8?

Comments

Sam Moore’s picture

You don't need a new theme. Just make a template for the content type by copying an existing one and making it specific to your content type. You do this by renaming the new template.

For example, if you want to create a specific template for forum posts, look in your theme for a template called node.html.twig. Copy that and rename the copy to node--forum.html.twig. You can now edit node--forum.html.twig and change the markup to suit your needs. Your CSS can target your new markup to provide specific styling for your forums posts.

Look in the Drupal 8 theming guide for more info on template suggestions, working with Twig, etc.
https://www.drupal.org/theme-guide/8 and especially https://www.drupal.org/node/2354645

The other thing you could look at is doing this from the admin interface; you may enjoy using Display Suite for tat, as it enhances the built-in Manage Display capability.

jeditdog’s picture

Thanks Sam
The second link you posted is exactly what I was looking for.

Jeff Burnz’s picture

If you get debugging running the template names are printed in the source code comments - it shows all possible template suggestions for all templates and which one is being used, and where it is (what theme/directory etc).