node_prepare

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 node_prepare($node, $teaser = FALSE)

Apply filters and build the node's standard elements.

▾ 5 functions call node_prepare()

blog_view in modules/blog/blog.module
Implementation of hook_view().
hook_update_index in developer-docs/hooks/core.php
Update Drupal's full-text index for this module.
hook_view in developer-docs/hooks/node.php
Display a node.
node_build_content in modules/node/node.module
Builds a structured array representing the node's content.
node_feed in modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.

Code

modules/node/node.module, line 1040

<?php
function node_prepare($node, $teaser = FALSE) {
  // First we'll overwrite the existing node teaser and body with
  // the filtered copies! Then, we'll stick those into the content
  // array and set the read more flag if appropriate.
  $node->readmore = $node->teaser != $node->body;

  if ($teaser == FALSE) {
    $node->body = check_markup($node->body, $node->format, FALSE);
  }
  else {
    $node->teaser = check_markup($node->teaser, $node->format, FALSE);
  }

  $node->content['body'] = array(
    '#value' => $teaser ? $node->teaser : $node->body,
    '#weight' => 0,
  );

  return $node;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen