Search code examples
htmldrupaldrupal-6

How to use node_load()?


Hi m a bit confused that how to retrieve node title by using this code

node_load($nid); $title=$nid->title;

i have done this coding in block and i wants to retrieve from node id for displaying image.that images are normally uploaded at the site by using filezilla and it has same name as the node title.i have tried many forms of node_load(),but i m failure.so please tell me right option for this. Thanks all.-Pranoti


Solution

  • Here is the reference for node_load

    http://api.drupal.org/api/function/node_load

    It returns an object which is the node.

    $node = node_load($nid); // $nid contains the node id
    $title = $node->title;
    

    Please get a good book on Drupal Module development to learn the fundamentals.