node

Create node programmatically with file

  1. <?php
  2.  
  3.   $node = new stdClass();
  4.   $node->type = 'photo';
  5.   node_object_prepare($node);
  6.    
  7.   $node->language = LANGUAGE_NONE;
  8.   $node->uid = $photo->client_id;
  9.   $node->name = $photo->client

Fix for remove node title link

  1. <?php
  2. // $Id: node.tpl.php,v 1.1 2009/02/28 23:33:58 jwolf Exp $
  3. ?>
  4.  
  5. <!-- start node.tpl.php -->
  6. <div id="node-<?php print $node->nid; ?>" class="node <?php print $node_classes; ?>">
  7.   <?php p

Node Templates by NID

  1. /**
  2.  * Override or insert variables into the node templates.
  3.  *
  4.  * @param $vars
  5.  *   An array of variables to pass to the theme template.
  6.  * @param $hook
  7.  *   The name of the template being rend

How to clone a CCK-heavy node form

  1. function myzipmodule_form_massupload(&$form_state = array()) {
  2.   $content_type = 'picture';
  3.   $form_id = $content_type .

theme node form

  1. function bewplatt_theme($existing, $type, $theme, $path) {
  2.   return array(
  3.     'bewertung_node_form' => array(
  4.       'arguments' => array('form' => NULL),
  5.       'template' => 'bewertung-node-form'

In teasers, display only the first field item.

  1. <?php
  2. function YOURTHEME_preprocess_node(&$vars) {
  3.   // In teasers, display only the first field item.
  4.   if (!$vars['page'] && count($vars['node']->field_YOURFIELD > 1)) {
  5.     $first_item = $vars[

remove node title link

  1. <?php
  2. // $Id: node.tpl.php,v 1.1 2009/02/28 23:33:58 jwolf Exp $
  3. ?>
  4.  
  5. <!-- start node.tpl.php -->
  6. <div id="node-<?php print $node->nid; ?>" class="node <?php print $node_classes; ?>">
  7.   <?php p

need help with node save

  1. /**
  2. * problem faced is that when it enters presave condition of the nodeapi
  3. * it enters function example_split and when it reaches the nodesave

Views2 field handler to link nodes to users

  1. <?php
  2. // $Id$
  3. /**
  4.  *@file
  5.  *The actual handler that provides the latest post(s) made by a user.
  6.  */
  7.  
  8. /**
  9.  * Field handler to provide the latest post(s) made by a user.
  10.  */

Drupal 5 set access to a node with hook_menu access

  1. /**
  2. *Define access for a node depending on the following condition
  3. * There is a date field defined (content_publish_date) ie publish date
Syndicate content