Search code examples
drupal-7teaser

drupal 7.x - Showing image of a content type in teaser via editing database directly


Because of some reasons I am not able to change the view of teaser of my content type using drupal's UI, so I have to immediately force drupal to show images of contents of one of my specific content types in teaser. So, Is there anyway to do it by editing a table of it's database or someone could give me a better idea? Thanks in advance \M/


Solution

  • You can override the node's template files in the site's theme. A full description of Drupal theme overrides is a large topic, and is version specific but hopefully this is enough to get you started down the right path.

    Drupal provides a series of naming suggestions for various templates you can use to override default behaviors (and your own code as well). In Drupal 7 would should be looking for node--[content-type-name]--teaser.tpl.php or node--[content-type-name].tpl.php and then add conditional for the various display modes.

    See also: the Drupal community documentation on node.tpl.php