drupal6

Drupal cheat sheet

02.07.2009
 von Pascal
 | 0 Kommentare

Snippets

Image Cache Usage

<?php
print theme('imagecache'$preset$image['filepath'], $alt$title,  $attributes); 
?>

Manually load a bunch of nodes with SQL

<?php
$nodes 
= array();
$sql "SELECT nid FROM content_type_event";
$result db_query($sql);
while (
$result && ($object db_fetch_object($result))) {
    
$nodes[] = node_load($object->nid);
}
?>

Manually load a menu

<?php
$menu_global 
menu_navigation_links("secondary-links"0);
$menu1 menu_navigation_links("primary-links"0);?>

programatically create CCK forms in Drupal 6

19.11.2008
 von Lukas Fischer
 | 0 Kommentare

This is the solution:

<?php
  $node 
= new stdClass();
  
$node->type 'document';
  
module_load_include('inc''node''node.pages');
  
$output .= drupal_get_form('document_node_form'$node);
?>
Inhalt abgleichen