Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Can I make the birth date optional or remove it from the sign up form?

derekdonderekdon New
edited January 2010 in Vanilla 2.0 - 2.8
Played around with Vanilla 1x before but no serious experience with Vanilla. Just looking at Vanilla 2 and like it but I've been wondering if I can easily make the birth date optional or remove it from the sign up form? Any pointers?




  • Options
    Okay I managed to do this but I had to comment out a couple of lines in some of the core files which I really didn't like doing. I know there must be nice way to override these functions and views so I guess I just have to find my way around a bit more. So far I haven't found a setting/variable switch to turn off the DOB requirement.

    So for anyone who is interested, this seems to be a successful dirty method of doing this:

    library/core/class.validation.php - comment out line 131
    //$this->AddRule('MinimumAge', 'function:ValidateMinimumAge');

    applications/garden/controllers/entry.php - comment out lines 210, 228, 262 & 303
    //$this->UserModel->Validation->ApplyRule('DateOfBirth', 'MinimumAge');

    Do this next step on whichever view you are using for user registration...

    applications/garden/views/entry/registerbasic.php - comment out lines 47 & 48
    //echo $this->Form->Label('Birth Date', 'DateOfBirth', array('class' => 'BirthDate'));
    //echo $this->Form->Date('DateOfBirth');

    Now go back and refresh your site's /entry/register page and you should notice the Birth Date field is gone and you can now register without errors.

    Hope this is useful.


    P.S. You can override views with a theme, so that would take care of the view part of this process... The core bits I'm still not sure about.
Sign In or Register to comment.