By x2222 on
Does anyone know a simple way to remove the "homepage" field in the comment form that shows up for anonymous users. I don't understand why this would be a standard option for commenting to ask people for their homepages. But does anyone know a way to remove it, without messing with any of the php code? Thank you.
Comments
Same task
Same task
_
http://drupal.org/search/node/delete+anonymous+homepage, 3rd link.
===
"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
Thanks, you again help me.
Thanks, you again help me. For record:
Add to your tempalte.php:
and create comment-form.tpl.php:
-------------------------
hh, Slovensko plati eurom.
Doesn't seem to work in D6,
Doesn't seem to work in D6, and this is the only post I find on the topic. Any other pointers?
Will like to know how to do
Will like to know how to do this too. The "Preview" disabling is already there in D6. Could not find anything to disable "Home page" which may be disturbing to users, as most of them dont have own sites.
Did you guys find a D6
Did you guys find a D6 solution?
What about doing a small
What about doing a small module that utilizes drupal_add_js and just hiding the field via simple javascript? It's a little hacky and would still show if a browser has JS turned off (though who does that nowadays?), but you can have a solution in just a couple lines of code.
It's quite easy
You'll need to add this to the appropriate CSS file of your theme:
Note this only works because the homepage field is optional. It's still there, being processed and all. Just not visible on the comment edit form.
Depending upon your expertise level, knowing which CSS file to edit may be another hurdle for you.
This explains some background info you should know before editing a theme's files:
http://www.missingubercartmanual.com/How-to-Customize-a-Drupal-Web-Site
Just read from "Overview of Customizing the Look of Your Site" thru the sub-theming section (about 6 paragraphs.)
And this walks through finding places in a theme's source CSS files, and how to safely modify them in a manner that you can still get updates to your theme (for bug & security fixes):
http://www.missingubercartmanual.com/How-to-Make-Changes-to-a-Drupal-Theme
-Blake
www.BlakeSenftner.com www.3D-Avatar-Store.com
Worked
This worked for me on Drupal 6
had to put the code just below the comment section in my style.css file
Man, you can't pretend to be
Man, you can't pretend to be an expert while offer css solution on this problem. Hiding text by css should always be avoided to the last minute.
An "expert" knows when a hack
An "expert" knows when a hack is the correct solution for something minor. Time spent on a more sophisticated solution is time wasted that should be spent on something that does matter. So what if an unused, and unwanted field is being processed with no data. Would you prefer a hook_form_alter() solution that most posters would ignore because they are not comfortable writing their own modules? The overhead of a module solution is more expensive in every respect that comes to mind than simply hiding the dumb field...
-Blake
www.BlakeSenftner.com www.3D-Avatar-Store.com
i do not agree, it starts
i do not agree, it starts small with a minor change trough your own module. But eventually your module will have 1000 lines of code because there always will be something you want different or that you don't want to be shown. So it's better to start with your own module then start with one hack and end up using hacks for everything.
I just used the solution here
I just used the solution here and solved my problem perfectly. Not only the "homepage" field, but also all customization in the comment form can be applied.
I bookmarked the link and kept note. Next time I will know how to do. That's better for me.
Pardon me if my word is aggressive. You may be a real expert but we have different points here. I like the idea of separating markup and display, that's where drupal shines. What you mentioned is to mix them, just to get things done. Besides, I never hide text by CSS. I'll try other methods and use JS as last resort though that's rare.
-
Old thread but I need to throw in my two cents to point out to novice users how bad this is. CSS hacks are called hacks for a reason. CSS is for cosmetics. Hiding an unused field is not cosmetic. Never ever use css to hide a field; no matter how much faster it is compared to the right way. That should be applied to anything actually. Keeping things separated and done the correct way will help keep a happy healthy Drupal site.
----
Sudo Kill Cylons
Removing Your name, E-mail and Homepage input fields
In case you would like to remove all extra fields (Your name, E-mail and Homepage) from the "Add your comment" form, go to: Administer › Content management › Page (or some other content type), open Comment settings, and in Anonymous commenting radio group select "Anonymous posters may not enter their contact information".
create your own module where
create your own module where you place all this kind of things.
use form_alter() for altering the comment form see; api.drupal.org
Add to your
Add to your template.php
Add to your template.php
The Stan.Ezersky solution worked for me for D6! I do feel better about not using CSS. I get a lot of traffic from malevolent bots. Hopefully this will prevent spam URLs in guest comments.
hide fields from post comment form
I did this by editing my core module. Added these lines just before the output return in module/comment/comment.module function comment_form() .
/* Unset the comment fileds . */
This is just a patch but worked for me.
Great thread guys! Thanks for
Great thread guys! Thanks for posting! The above code for the template.php file doesn't seem to work for me. Does anyone know how to remove this homepage field from the comment section on Drupal 6?
I would like to completely remove it from outputting to the screen as opposed to just hiding it. The reason for this is because of spam bots.
I had anonymous comment posting available on my site for the past year and only had a very random spam submissions, and thankfully the awesome Mollom module caught these and discarded them. However, I wanted to enable users to be able to anonymous subscribe to their comments. So I enabled this, but I had to turn on the option to allow for anonymous users to leave their email and contact details, which opened up this dumb homepage field.
Literally a day after I enabled this, I received a good 30-40 spam submissions in comments, purely because I had the homepage field listed there and spam bots thought they could get away with posting link backs to their sites. Mollom of course caught all of these and put them in moderation, but now I have to deal with 90 spam comments to delete from the queue. I prefer to have none. My assumption is that if I remove this stupid homepage field (again, no idea why Drupal would have this in their by default), I won't receive these 30-40 comments per day.
I would greatly appreciate the help in removing this homepage field. Thank you in advance!!
Hey guys...I found this great
Hey guys...I found this great writeup, which clearly explains step by step how to remove this annoying homepage field. The correct and easy way with Drupal and using the template.php file.
http://www.digett.com/blog/06/29/2010/how-theme-comment-form-drupal-6
This works, farewell spammers...until the next battle. ;)
=-=
Can we please update this for
Can we please update this for drupal 8?
Simply using CSS display: none doesn't work for web crawlers and creates problems because the api inserts the link into the name of the commenter, whether or not they are anonymous.
Where is a good description of how to remove the homepage field programatically?
Thanks.
same here. Searching for a
same here. Searching for a solution in Drupal 8
This code in your NAME_THEME
This code in your NAME_THEME.theme file solved it for me:
Thank you!
Thank you!
Seems so simple in hindsight, but I just didn't have a firm enough grasp on the new file structure for 8.
Thank you. Worked for me too.
Thank you. Worked for me too.
Thank you @hilrap !
Thank you @hilrap !
Still works
This still works for D9. Thank you! :-)