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.
There's no need for an extra query in hook_preprocess_page() to determine the name of the node type being viewed. Instead, you should use node_type_get_type() since that information is most likely already loaded and statically cached.
Comment | File | Size | Author |
---|---|---|---|
#1 | tb_methys-avoid_node_type_query-2054177-1.patch | 920 bytes | mstef |
Comments
Comment #1
mstef CreditAttribution: mstef commentedPatch