By stafford on
Hi,
On our drupal site the newest comment is on the top. I'd like to move the comment form above the existing comments.
Thanks
stafford
Hi,
On our drupal site the newest comment is on the top. I'd like to move the comment form above the existing comments.
Thanks
stafford
Comments
Go to
Go to ?q=admin/comment/configure - there you will find it.
"Viewing options" -> "Default display order:"
Date - newest first
Date - oldest first
Yes, that works. The newest
Yes, that works. The newest comment is on the top. But I need the comment form (textbox) above the newest comment.
any other idea?
any other idea?
pls help somebody! :) our
pls help somebody! :) our users need this feature :)
cannot be done without
cannot be done without hacking a core drupal module or creating a new module.
The settings are to use on new page, or same page. it is unnatual to have a comment posting field above comments. typically one would read the comments beofre posting, not post before reading.
It may be possible to override this at theme level. Something for you to look into to create this effect for yourself.
I got a tip yesterday:
I got a tip yesterday:
I moved this line
under this line:
$output .= "<a id=\"comment\"></a>\n";and it works.
I modified a local copy of D5 comment.module
Question about the above code
If I read this correctly, this patch allows you to set the comment form to show above or below the list of comments. I presume that if you set it to show above the comments and on a new page that you would then see the comment form followed by the comments after having clicked a link to add a comment?
Additionally, would it not be better to override this in the theme template (?) instead of modifying one of the core modules?
2 years later
Not being comfy modifying core, I just thought I'd post a tentative CSS solution.
The comment form lives in a wrapper with class="box". On node pages, "box" lives inside the div with id="comments". To get the comment form above the first comment, just absolutely position #comments .box {} at top:0px, give it an explicit height, and then add a padding-top to #comments that is the same size as that height in order to push the first comment below the form you just positioned.
So your markup is something like:
And your style is:
Obviously, if you have styling or markup inside "box" that will cause the content to exceed your height, it will overlap the first comments in the comment list. Also, browsers with resizable textarea boxes will resize overtop of any other regular markup, as the absolute positioning takes it out of the flow (at least, I think that's the reason).
I'm not a seasoned CSS builder, so if anyone out there knows any situations (especially common ones) that will break this, please post!
:)
Nice solution
Nice solution it works fine. Its cool :-)........ thank u
No probs - glad it works! (I
No probs - glad it works! (I can uncross my fingers)
;)
Me too
Just agreeing that this is a funny limitation of drupal. Many users are now used to Facebook-wall-style commenting where the submission form is at the top, with the newest comments just below. This really needs to be added as an option in core.
http://drupal.org/project/com
http://drupal.org/project/comment_form_above_comments
Pages and panes
The folks who built our site controlled this with a page and panels that build the node, its content, then the comment and comment form.
So, moving the comments and comment form around was a matter of figuring out which panel in admin/build/panels shows nodes and comments. Then editing the panel's content, and moving panes around with a drag and drop interface. (This after hours of trying to do it in the templates and figuring out how the page was rendering. It's only simple if you know it's there!)
I thought I'd mention it in case anyone else is dealing with a site built with Panels in a similar way. I didn't have to install the "move comment form above comments" module at all.
You can render comments
You can render comments manually easily to do this with:
print comment_form_box($edit) . comment_render($node);Details: http://www.saigonist.com/content/drupal-add-comment-form-above-comments
My blog on Drupal/Vietnam: Saigonist
Twitter: @tomosaigon / @tomodrupal
How about simple jQuery instead of core hacking?
I added the following to the footer in a block
@Georgii: this worked easily,
@Georgii: this worked easily, thanks.
Nice to hear that! :)
Nice to hear that! :)
Module for comments forms above comments
Module for comments forms above comments
Hello,
Does it mean that there is no module or any easy way to put the comment form above the comments ?
Thanks.
=-=
a google search and an investment of 5 minutes located http://drupal.org/project/comment_form_above_comments
Nothing new ?
Nothing new since ? As this module is a bit old.
Thank you anyway.
=-=
The age of this type of module has no bearing since it's a theme function and the apis in drupal 6 don't change. Realistically you don't "need" a contrib module to do this. It (the module) was created so that users wouldn't have to write any code.
Comment form above the comments.
I am facing the same issue. but just resolved it. I also tried with the module http://drupal.org/project/comment_form_above_comments but didn't get any solution. But just resolved this by editing the core module. What i did is :
in file /module/comment/comment.module edited a function named "comment render()"
Just changed the sequence of placing the comment form.
Editing core is dangerous and
Editing core is dangerous and highly unrecommended. Please consider one of the other approaches given above.
Rendering comment form above comments in Drupal 7
How does one render the comment form - above the comments
so how do you render the comment form and then render the comments for the node.
=-=
http://drupal.org/node/1142044
Override comment-wrapper template
You can override the comment-wrapper.tpl.php, copy it from modules/comment to yourTheme/templates directory.
And the place the render of the form above your rendered comments like so.
To move the comment field
To move the comment field above the existing comments in Drupal 8/9:
{% if comment_form %}
<h2 class='title comment-form__title'>{{ 'Add new comment'|t }}</h2>
{{ comment_form }}
{% endif %}
above this code:
{% if comments and not label_hidden %}
{{ title_prefix }}
<h2{{ title_attributes.addClass(title_classes) }}>{{ label }}</h2>
{{ title_suffix }}
{% endif %}
{{ comments }}
Clear cache.
somehow not working
i m trying this in different ways.. but not working. Using Bootstrap5 theme with some customisations