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.
By jeditdog on
I want to customize how some of my content types display. Where do I do this at in Drupal 8?
Comments
You don't need a new theme.
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.
============================
Resonetrics: Better Tools for Building Brands
http://resonetrics.com
http://technologyformarketers.com
http://kittenassociates.org
http://www.linkedin.com/in/sammooreatresonetrics
Documentation looks great
Thanks Sam
The second link you posted is exactly what I was looking for.
If you get debugging running
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).
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.