Users normally expect that:
a) When looking at a bunch of posts on a page, at the bottom of each it says something like "73 comments / 2 new comments". This is, of course, the Drupal default for a Teaser (or for a View that shows Teasers).
b) If looking at a post's own page, at the bottom it says something like "Add new comment," with either the comments shown, or a link to "show comments". (This, of course, Drupal's default behavior for a content Node).

But what happens if we have a View that displays Full nodes?
The link says "Add comment," with no indication of how many comments there are--and neither "show comments" nor the comments themselves. So it doesn't look either like a) or b)....

But to the user, it looks like "a bunch of posts," and they expect to act like a). Of course, to Drupal, it's a "Full" node display, so it behaves like b--only without the actual comments. Kind of the worst of both worlds. (See http://playthisthing.com.)

So: Can you think of an easy way to force $links to show up in "teaser" mode even on a Full View? And maybe you want to make that part of the Views module by default, since it seems more likely to conform to user expectations in general...

My alternative is an ugly hack to comments.module, which I may wind up doing, but elegant it ain't.

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Bad news for you, Greg. Here's Views' code that handles this:

/**
 * Display the nodes of a view as teasers.
 */
function theme_views_view_teasers($view, $nodes, $type) {
  return views_theme('views_view_nodes', $view, $nodes, $type, true);
}

/**
 * Display the nodes of a view as plain nodes.
 */
function theme_views_view_nodes($view, $nodes, $type, $teasers = false, $links = true) {
  foreach ($nodes as $n) {
    $node = node_load($n->nid);
    $output .= node_view($node, $teasers, false, $links);
  }
  return $output;
}

As you can see, they both do the exact same thing, except that the $teasers flag in node_view() is either TRUE (for the teaser variant) or FALSE (for the full nodes variant).

The construction of the actual links is handled by the comment_link() function, and there really isn't much Views can do about that.

I don't think you necessarily have to hack comment module, though. I think what you really have to do is change what 'teaser' means for those particular nodes. Which, I'll admit, could be tough. But your node.tpl.php and _phptemplate_variables() can generate a different teaser or something. It's a bit of a sticky problem.

And it's not one that Views can solve on its own. :/

twohills’s picture

Yes it can

For me at least this would be fixed if the $links parameter was a controllable option in the View

Also note that this is a themable function, so you could write a theme fuinction to links on and off somehow - that's what i think i'll be doing