开发者

Drupal 7 user registration: creating mandatory gender/city fields

I'm a Drupal newbie, but have successfully installed it at a CentOS 5.5 Linux, PostgreSQL 8.4.7, PHP 5.3 machine.

I've chosen minimal installation and then enabled following modules: Block, Image, Locale, OpenID (hope to add Google accounts later...) and Search. The User module etc. are enabled by default anyway.

My problem is:

I don't know how to add Gender/City fields and make them mandatory.

As a SPAM-fighting measure at my old phpBB 3 site I have a mandatory question for new users about their gender: Robot/Male/Female and the first answer is default and prevents the new user from registering.

Is it possible to do the same in Drupal 7?

And I hope it is doable without installing any additional modules as the stock i开发者_运维问答nstall is easier to update. (That is what I was doing with my old phpBB site - with no mods installed).

Thank you for your answers! Alex

UPDATE:

Here is my Field module screenshot, does it look ok? Maybe my problem is that List is shown as disabled?

Drupal 7 user registration: creating mandatory gender/city fields


First, note that there is a huge difference between Drupal modules and phpBB mods. Drupal provides API's which allows modules to integrate with Drupal without changing any code. You can just download them into a folder, enable and they are running.

And yes, what you are trying to do is possible without any additional modules. Just go to admin/config/people/accounts/fields, add a Gender field of Type "List (text)" (If that is not available, you might need to enable it, but it part of Drupal core), then, enter the allowed values and on the second page, check the "required" and "shown on registration form" checkboxes and you are good to go.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜