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.
What's the best way to determine the original content-type in the node--nodeblock.tpl.php
template?
At the moment, I'm using what seems to be a rather convoluted method, i.e via a field in the content-type: $content['field_myField']['#bundle']
However, that depends on this field being present in all content-types that I might want to use for nodeblock - which won't always be a valid assumption.
Comments
Comment #2
Johnny vd Laar CreditAttribution: Johnny vd Laar at ezCompany commentedIt's a normal node.tpl.php so you have all variables that are documented here https://api.drupal.org/api/drupal/modules!node!node.tpl.php/7.x.
Comment #3
Johnny vd Laar CreditAttribution: Johnny vd Laar at ezCompany commented