Having the ability to stick the comment form above the comments is definitely something that should be in core.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

+1 Agree

neochief’s picture

Project: Comment form above comments » Drupal core
Version: 6.x-1.0 » 7.x-dev
Component: Miscellaneous » comment.module
Status: Active » Needs review
FileSize
4.1 KB

Done. Please support this patch with your review.

neochief’s picture

Title: Core Worthy » Comment form above comments

Changing the title.

Status: Needs review » Needs work

The last submitted patch failed testing.

neochief’s picture

Status: Needs work » Needs review
FileSize
4.1 KB

Update for TB.

Status: Needs review » Needs work

The last submitted patch failed testing.

neochief’s picture

Status: Needs work » Needs review
FileSize
4.33 KB

Another try.

mikeytown2’s picture

Status: Needs review » Needs work

There are CR characters in the patch. Also I just tried this out with a brand new D7 install and it doesn't work as advertised. Comments are in the same place as Display below post or comments when I select Display below post, but above comments.

neochief’s picture

Did you cleaned the drupal cache? There is new template file, and if you just patched existing installation it should not work.

mikeytown2’s picture

Patched then installed. Cleared the cached and it did nothing.

yched’s picture

This is now entirely doable by overriding the content-wrapper.tpl.php template. Might be only me, but adding a UI option for this is overkill IMO. If we go this way, there's a long list of UI options we could add...

neochief’s picture

@mikeytown2, are you sure? I just tested patch on fresh D7 installation, everything works fine.

@yched, yes, agree, It can be done by making a new template (and patch adds this emplate). But I don't think that it's an option for which user should add a template manually.

mikeytown2’s picture

Status: Needs work » Needs review
FileSize
4.71 KB

Figured out the dumb problem. patch < comment_form_above_comments_1.patch dumped comment-wrapper-form-above.tpl.php in the drupal root even though it's supposed to go in modules/comment.

Attached is the patch without the CR line endings

mikeytown2’s picture

Status: Needs review » Reviewed & tested by the community

patch works, and its quite useful IMHO.

webchick’s picture

Status: Reviewed & tested by the community » Needs review

Hrm. Really? You want people commenting without having read the discussion so they repeat the same info other people did? :P That seems like a recipe for annoyance.

I'm tempted to make this a theme-only thing and not expose a UI option for it. Is there a precedent for this elsewhere on the web / other CMSes?

Also, I'm not quite enthusiastic about this implementation. We do not have a comment-wrapper-form-below.tpl.php. Why do we need a comment-wrapper-form-above.tpl.php?

VM’s picture

the idea I believe sounds similar to the "quick reply" features found in forums where one doesn't really read the comments of other users but wants to quickly comment on the thread itself.

webchick’s picture

But even then, the "quick reply" form is found at the bottom of the comment listing. See phpBB, punBB, etc.

moshe weitzman’s picture

This is contrib material, IMO.

agree with webchick that a new template for this is absurd.

VM’s picture

webchick, my apologies. don't know why I thougt it was directly after a post. Drupalized too long I guess.

kaakuu’s picture

"Is there a precedent for this elsewhere on the web / other CMSes?"

Probably NO!

Drupal Guestbook module has this feature where it gives the option to place the gb comment form either at top or bottom. Typically the placement of form at the top happens in case of Profile comments like Google's Orkut or other social sites.

The other example of quick comment form is on hover - in blursoft's forum script you can read the last comment on hover over the last commentor's name in the topic list, and reply on hover too without the need to open a thread which you already have been following. That is their unique nifty core feature.

Drupal already has excellent comment form options in core, and contribs like "talk" extend that to almost all the possibilities a CMS can have :)
I do not feel we need a comment form at the top.

RobLoach’s picture

Having the form at the top of the comment content is slowly becoming a standard among social websites. Some examples of large sites that have the comment form at the top:

  • Facebook's wall posts
  • Last.fm's Shoutbox (example)
  • Twitter/Identi.ca status updates
  • Optionally YouTube's video (example)
  • DailyMotion (example)
  • ........... etc

Since we already have the option to stick it either under the comments, or on another page, it makes sense to also have an option to put it at the top of the comments. Drupal's Comment module needs as much help as it can get, and this would be a great addition. The past two websites I've worked on, the client has asked for this feature. Definitely is core-worthy.

Status: Needs review » Needs work

The last submitted patch failed testing.

Cory Goodwin’s picture

I agree that this should be an option. The "Add new comment" link is already at the top directly under the node. The philosophy of not forcing the reading to scroll through the other comments if the reader only wants to respond to the node is already ingrained in Drupal.

JohnAlbin’s picture

Version: 7.x-dev » 8.x-dev

We missed code freeze.

Given the way comment-wrapper.tpl.php works, you won't be able to implement this feature as a contrib module without overriding the default comment-wrapper template. Which may cause incompatibilities with some themes' styles.

JohnAlbin’s picture

Status: Needs work » Closed (won't fix)

Actually, this is a better way to fix this problem, IMO: http://drupal.org/project/commentblock

:-)

Comments and comment form as blocks might be core-worthy. Not crazy about this issue. I hope no one minds me "won't fix"ing it since its already fixed in contrib. :-)

gynekolog’s picture

Status: Closed (won't fix) » Needs review

#7: comment_form_above_comments.patch queued for re-testing.

gynekolog’s picture

#13: comment-539216.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, comment-539216.patch, failed testing.

korund’s picture

Status: Needs work » Needs review

#13: comment-539216.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, comment-539216.patch, failed testing.

gansbrest’s picture

Here is my quick and relatively dirty solution for this (Drupal 6):

Copy comment-wrapper.tpl.php to your theme if you don't have it there already and then slightly modify it:

// Separate form from the body to attach it to the top
$regex = '|<div class="box".*</div>|is';
preg_match($regex, $content, $pock);
$commentSubmitForm = $pock[0];
$content = preg_replace($regex, '', $content);
<?php if ($content): ?>
  <div id="comments">
    <?php print $commentSubmitForm . $content; ?>
  </div>
<?php endif; ?>

The idea is to separate form html from the comments area and attach it to the top later on.

Works pretty good, no need to patch core, but I agree - the comment module is sort of strange / messy and that functionality should be in core at some point.

gynekolog’s picture

works, thank you!

VM’s picture

Status: Needs work » Closed (won't fix)

remarking won't fix per #25

devkinetic’s picture

FWIW, I'd like to not have to install another module for this. I see no reason why the theme function cannot output two variables; one for the form, another for the comments.

I'm using D6 and took the code from #33 and implemented it from within template.php.

function THEMENAME_preprocess_comment_wrapper(&$variables) {
  $regex = '|<div class="box".*</div>|is';
  preg_match($regex, $variables['content'], $pock);
  $commentSubmitForm = $pock[0];
  $variables['content'] = $commentSubmitForm. preg_replace($regex, '', $variables['content']);
}

This should be the preferred method over putting this code in the template file.