No overwrite function for Drupal 7 in readme.txt

Created on 2 March 2014, almost 11 years ago
Updated 5 June 2023, over 1 year ago

I'm trying to display the title with the image in Drupal 7 to be used as a caption for the header. The documentation said that there's a function in the readme.txt file. I found the function in the Drupal 6 version and well...it doesn't work in the D7 version but I guess that was a long shot. Below is the function from the D6 version. If I can just get the D7 equivalent that would be perfect. It would probably help any others who are trying to overwrite the default behaviour and display other fields as well, other than the image.

function phptemplate_headerimage_block($node, $teaser = true) {
  if (!$node->status) {
    $output  = '<div class="node-unpublished">';
  }

  if (module_exists('taxonomy')) {
    $terms = taxonomy_link('taxonomy terms', $node);
  }

  $output .= t('!title by !name', array('!title' => '<h2 class="title">'. check_plain($node->title) .'</h2>', '!name' => theme('username', $node)));

  if (count($terms)) {
    $output .= ' <small>('. theme('links', $terms) .')</small><br />';
  }

  if ($teaser && $node->teaser) {
    $output .= $node->teaser;
  }
  else {
    $output .= $node->body;
  }  

  if ($node->links) {
    $output .= '<div class="links">'. theme('links', $node->links) .'</div>';
  }

  if (!$node->status) {
    $output .= '</div>';
  }

  return $output;
}
💬 Support request
Status

Closed: works as designed

Version

1.4

Component

Documentation

Created by

🇹🇹Trinidad and Tobago ainz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024