By bighead03 on
hi,
I would like to customize the comment form
I allow annonymous user to leave comment
by default, the form would show the name, email and homepage field for anonymous user, and show the username for login user
what I would like to do is, remove homepage field (which I think can be done in phptemplate_comment_form function), but i also want to add login/password field if the user is not logged in
form_alter maybe a choice, but is there an easier way to do it?
and, should the form_alter function implement on the comment.module file if I must use that to implement it?
could someone provide me more details on this one? thanks in advance
Comments
Never in the core module,
Never in the core module, but in your custom module use following.
user_login_block():)
Beautifulmind
Regards.
🪷 Beautifulmind
You can
hi,
first of all annonymous user can leave comment no problem.
by default, the form would show the name, email and homepage field for anonymous user, and show the username for login user
when you click on Add new Comment link form will show you only subject & comment from where email & other form has come. r u using something else as i understand.
form_alter maybe a choicechange in drupal core modules or any other module form_alter is best option.
Kamlesh Patidar
what I would like to do is,
If you wanna display user login form along with the comment form, you should user the
user_login_block()About altering the any kind of form..
Never add your code in core modules
About hiding the homepage filed: add a div with hide option.
:)
Beautifulmind
Regards.
🪷 Beautifulmind
i am hesitant to modify code
i am hesitant to modify code in core modules too, but i'm reading many examples on the net, so...
anyway, thanks, i think it could work for me
if, in case, i would like to add a login link if the user is anonymous, how should i do so?
i would like to add in between the Your name and Subject field, how could it be done?
thanks a lot!
I've just found out how myself
hello,
I was googling for the same thing just this morning and I ended up discovering how to do this by trial and error.
here's how:
1) suppose you have installed drupal in www.example.com/drupal. login as administrator;
2) access www.example.com/drupal/admin/content/comment/settings OR click Administer > Content management > Comments > Settings;
3) there's several options in this page, you can try them all. but I suppose you'll want to scroll down to "Posting settings" and choose "Anonymous posters may leave their contact information";
4) click "save configuration" and logoff;
5) access any node where you can leave comments and you'll see the form now has extra fields:
- name;
- e-mail;
- homepage.
unfortunately, I don't know how to switch off the homepage field while leaving the e-mail field, but that should be enough for anonymous users to identify themselves, right? ;]
hope this helps. if you're still stuck, send me an e-mail through my contact page.
cheers,
Luciano
_________________________
"There is no off position on the genius switch."
- David Letterman
In which Drupal version do
In which Drupal version do you have these options?
In 6.9 I don't have any.
Regards,
Serge
_
In d6 comment settings have been moved to the individual content types.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz