All Questions
25 questions
20
votes
3
answers
8k
views
Remove subject field from comments
Is it possible to remove the subject field on comment forms? I find it to be kind of useless and redundant, since the subject of the comment is usually the title of the article being read, at least ...
7
votes
1
answer
6k
views
Print the comment form with PHP
I'm trying to print a comment form with the following code.
<?php
print drupal_get_form('comment_form', array('nid' => $row->nid), t('Post new comment'));
?>
All I get is the ...
5
votes
2
answers
9k
views
Removing input formatting options and description from comment form
How do I remove the input formatting options and descriptions from the comment form?
I'm not interested in a CSS and/or jquery based solution, nor am I interested in using the Better Formats module, ...
5
votes
1
answer
4k
views
How to change "Your name" label in comments form?
I have a blog with comments and I need to change the "Your name" field to something different and make it a required field.
Can I do this from hook_form_comment_form_alter() hook in template.php or ...
3
votes
1
answer
607
views
After using unset($form['author']); for comment module drupal returns errors
As I would like to allow users print their names with comments I added a new field called comment_name. To not have 2 fileds with name I used the code to unset filed "name" from comment.module
...
3
votes
1
answer
170
views
Programmatically added comment form on node page doesn't work
I have attached a view which displays comments to basic page content type using EVA module. I've also implemented the following to have the "add comment" form displayed just above the comments list:
/...
2
votes
1
answer
1k
views
How to find out a node's comment status (open, closed) from node ID?
Having a view of comment fields here that is embedded into another view via Views Field View module. The comment view has a contextual filter: the nid. Works quite nice.
Now I want to hide the view ...
2
votes
1
answer
348
views
Adding the current node title as the value of the comment form title?
I want a value to be automatically added to the title text-field in the comment form ; this value would be indeed the current node title.
I've started working on a hook_form_alter() (added in a ...
2
votes
2
answers
1k
views
How to render comments at the top and the comment form at the bottom?
I'm trying to display the comments on a node at the top of the page. I've edited node.tpl.php in my theme to be:
<article id="article-<?php print $node->nid; ?>" class="<?php print $...
2
votes
1
answer
561
views
How to show custom error messages below text field?
I want to display custom error messages below that text field in comments form. Currently it displays all error messages above the page which is not acceptable.
I'm using this theme for my blog. I ...
1
vote
1
answer
528
views
D7 Form Builder and Comment Forms [closed]
I need to create a post/comment structure almost exactly like what you're looking at right now: original post with comments, subsequent 'answer' posts with their own comments. In response, I'm ...
1
vote
1
answer
779
views
How can I make form_alter work with Ajax Comments?
I did some manipulation (with JavaScript and CSS) on my comment form. It works good. Then I needed to install the Ajax Comments module because I don't want visitors to go another page while replying a ...
1
vote
1
answer
1k
views
form_comment_form_alter modify comment body
I am using hook_form_comment_form_alter to add values to the textboxes in the commenting form. But in the comment body I can seem to add a default value
and can't seem to find a value that I can ...
1
vote
1
answer
769
views
D7 comment form doesn't submit
I've successfully printed a comment form on a views-built page using a PHP Views field (as found in this question). The form doesn't submit right away though - instead of submitting, the comment "save"...
1
vote
1
answer
929
views
How do I remove default comment validation in drupal 7?
Drupal is showing error message for empty comments by default. how can i remove that error message.
Note:- (I have not written any custom validation. It's the default validation provided by drupal ...
1
vote
1
answer
410
views
comment body size in hook_form_comment_form_alter
What is the correct syntax to alter the size of the comment form body text area? I can't for the life of me find it in devel dpm.
$form['comment_body']....something....
1
vote
0
answers
812
views
AJAX submit ignored if comments form is loaded with AJAX
In D7, I have a custom module enabling AJAX form submission on comments forms. That is working great.
I also have comments being loaded in the commentsblock module using block_refresh with the below ...
0
votes
1
answer
160
views
Remove all Div wrapper from comment form
I want to strip all default Drupal form wrappers and have something like below in comment form output
<form>
<input type="text" name="name" ...
0
votes
1
answer
47
views
How to embed all comments and comment form to other website
I have two sites.one is Drupal site (example1.com). It has a lot of comments. I want to embed all these comments and comment form to other site (example2.com)[non-Drupal site].
Is it possible?
0
votes
1
answer
92
views
Comment Forms - place label inside the inputs
I'm theming a comments section on a page in a D7 site.
What I want is for the label for the forms items to show as a placeholder attribute rather than above the element.
I've used a hook_form_alter ...
0
votes
2
answers
258
views
change comment form container to textarea
How to remove the red section in next image (comment form)?
I have try change the type to textarea, but on submit the form a blank page appears.
function THEME_form_comment_form_alter(&$form, &...
0
votes
2
answers
424
views
_form_comment_form_alter for certain node type
When using the hook_form_comment_form_alter, how do I only target the comment form of a single content type?
Right now it is targeting all comment forms, and I need it to just target the 'Blog' ...
0
votes
1
answer
211
views
Render comment edit form in block
I am using following code to render node comment form in a block:
$comment_form = drupal_get_form('comment_node_<node_type>_form', (object) array('nid' => $nid));
print drupal_render($...
0
votes
1
answer
470
views
How to add comment form to drupal pages not having node and content type?
mymodule.module
function mymodule_theme() {
return array(
'mymodule_results' => array(
'variables' => array('var1' => null, 'continent' => null, 'country' => null, '...
0
votes
2
answers
643
views
Add class to all labels in a comment form
Pretty straight forward. For every label within a comment form, I wish to add a particular class to it. Using only functions in template.php, in Drupal 7, how can this be done? If it can't be done ...