I am working on a Drupal project where I require a "Create new account" form on a content page. Can anybody help me out with this? Is there any module or any alternative to get "Create new account" as a block?


Use this module http://drupal.org/project/formblock

Download and install the module. Navigate to admin/structure/block You can see Registration form as a block and choose the region to appear.

enter image description here

User Registration to appear in a block taken from this source.

| improve this answer | |

You can can create block programmatically. And create your own callback function where you can call drupal_get_form and render user_register_form.

For example your callback function will look like this: Basic example

 * Implements hook_block_info().
function yourmodule_block_info() {
  $blocks = array();
  $blocks['my_block'] = array(
    'info' => t('My Custom Block'),

  return $blocks;
function hook_block_view($delta = '') {
    switch ($delta) {
    case 'my_block':
          $block['subject'] = t('Register form');
          $block['content'] = yourmodule_block_register_callback();

function yourmodule_block_register_callback() {
   $reg_form = drupal_get_form('user_register_form');
   $output = drupal_render($reg_form);
   return $output;

If you are not familiar with the creation of custom modules - read this.

| improve this answer | |
  • Is it not possible through modules or something which is not so programmatic. – user7048 Apr 3 '13 at 13:39
  • it's not as difficult as it seems – Petro Popelyshko Apr 3 '13 at 13:41


Create a new block, copy/paste this code in the body:


if(user_is_anonymous()) {  
  $form = drupal_get_form('user_register_form');
  print drupal_render($form);


Make sure the block is set to PHP filter

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy