CCK form in a block

oryx71 - October 2, 2007 - 16:53

Is it possible to put a cck form in a block? I want anonymous visitors to be able to post in a form and authenticated users to view what have been posted in views.

/ Pierre Andersson, Sweden

Hej Pierre!

zoo33 - October 4, 2007 - 06:42

Hej Pierre! Äntligen använder också du det rätta publiceringssystemet!

The quickest way should be to add a new block with PHP input format. In that block, call drupal_get_form() and output the result of that. You could do the same using a custom module. Try this (not sure if it will work, haven't tested it):

<?php

global $user;
$type = 'pierresnodetype';
$node = array('uid' => $user->uid, 'name' => $user->name, 'type' => $type);
print
drupal_get_form($type . '_node_form', $node);

?>

/Hannes

Thanks

oryx71 - October 5, 2007 - 08:44

It works just fine. Tack!!!

 
 

Drupal is a registered trademark of Dries Buytaert.