content type
Embedding a content type node form with Drupal 6
How do you invoke or embed a content type node form in Drupal 6? Following code shows how to:
<?php global $user; $type = 'garden'; $node = array('uid' => $user->uid, 'name' => $user->name, 'type' => $type); module_load_include('inc', 'node', 'node.pages'); $form = drupal_get_form($type .'_node_form', $node); print_r($form);?>
How to fix template files in IE6/IE7 when everything is working fine in firefox?
Simply, create a css for IE6/IE7 say it is ie6.css and/or ie7.css and add the following lines to page.tpl.php:
<!--[if IE 6]><style type="text/css" media="all">@import "<?php print base_path() . path_to_theme() ?>/css/ie6.css";</style><![endif]-->
<!--[if IE 7]><style type="text/css" media="all">@import "<?php print base_path() . path_to_theme() ?>/css/ie7.css";</style><![endif]-->
How to write a simple pager_query in Drupal that is sortable?
<?php
$list[]=array('');$rows[] = array('');$header = array(array('data'=>t('Title'),'field'=>'n.title'), array('data'=>t('Referral Author'),'field'=>'n.uid'), array('data'=>t('Time Created'),'field'=>'n.created', 'sort' => 'asc'), 'Average Rating');
Drupal Forms Module: Tutorial
Here is a small sample, make a file in modules/myform called myform.module and paste the following code into it. Enable the module to see it in action
