Without succes i have been searching to disable the phone and name field in the sign up block on my event node.
A sign up button only, similar to http://groups.drupal.org/node/19324 would be just fine.

How can i configure this?

Comments

dww’s picture

Status: Active » Fixed

See point #2 in the INSTALL.txt file.

held69’s picture

Thanks, i kind of overlooked this file.

Despite that i have hardly any experience with php i want to give it a trie to remove the NAME and PHONE field.
I have read the instructions in the install file and the signup_form (theme) as well.
This leaves me with some questions though.

To customize this for your site, copy this entire function into
* your theme's template.php file,

1.I'm a bit confused here by the words "entire function". Can i just copy everything from the signup_form into my
theme's template.php file?

2.Do i have to paste it at the top or the bottom of my theme's template.php file? Or does it make no difference.

rename the function to phptemplate_signup_user_form(),

3.So in function theme_signup_user_form($node) i rename theme_signup_user_form into
phptemplate_signup_user_form?

and modify to taste.

4.So now i'm left with this code. What do i alter?
Can i just remove the blocks with phone and name in it?
The words "DO NOT EDIT OR REMOVE" are not making me feel very secure :)

 // If this function is providing any extra fields at all, the following
  // line is required for form form to work -- DO NOT EDIT OR REMOVE.
  $form['signup_form_data']['#tree'] = TRUE;

  $form['signup_form_data']['Name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#size' => 40, '#maxlength' => 64,
    '#required' => TRUE,
  );
  $form['signup_form_data']['Phone'] = array(
    '#type' => 'textfield',
    '#title' => t('Phone'),
    '#size' => 40, '#maxlength' => 64,
  );

  // If the user is logged in, fill in their name by default.
  if ($user->uid) {
    $form['signup_form_data']['Name']['#default_value'] = $user->name;
  }

  return $form;
}

Thanks

dww’s picture

(Side note: this whole thing is stupid and crazy, and should go away. See #29568: Flexible number and type of fields)

I guess you missed this in the comment above theme_signup_user_form():

* If you do not want any additional fields, the function can simply
* return an empty array: "return array();"

So, all you need is to put this in template.php (and no, the order doesn't matter at all):

function phptemplate_signup_user_form($node) {
  return array();
}

Cheers,
-Derek

p.s. If someone marks your support request "fixed", and you still have questions or can't get something working, you should set it back to "active". However, since I just answered your question, I'd set it back to "fixed" with this comment. ;) So, assuming this works for you, you don't have to reply at all nor change the status.

held69’s picture

Derek,

Thank you very much.

It worked straight out of the box.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

modctek’s picture

Version: 6.x-1.0-rc3 » 6.x-1.0-rc6
Status: Closed (fixed) » Active

I've noticed that this work-around does not work with signup_status enabled, possibly because the function call has been co-opted or renamed. Any hints how to proceed without disabling signup_status?

dww’s picture

Status: Active » Closed (fixed)

It works fine. Of course, if you have the signup_status module enabled, and some options configured to appear on the signup form, those are *going* to appear on the signup form. That's obviously by design. ;) This support request is about hiding the custom fields like Phone and Name, and it works (I just re-tested to be sure) exactly as described here, even with signup_status enabled.

vjecnomlad’s picture

Version: 6.x-1.0-rc6 » 7.x-1.x-dev
Status: Closed (fixed) » Active
function phptemplate_signup_user_form($node) {
  return array();
}

I tried to copy that function to my theme's template.php, but nothing happens at all.
Is there anything else I have to do, to hide the phone and name field?
I use the drupal 7 version.

Bertjuh’s picture

You are responding to a topic that is 3,5 years old. But have you flushed the caches?