Well, Discuss link is easy to theme, but the thing I'd like to theme are the comments displayed under the text in a node.

They are outputed in "div id=comments" which is nested under "div class="content". I'd like to have them outside this content class, like a separate class. I use Acquia marina and the current output is:

div class=meta
div class=content
div class=links
div class=terms

As mentioned, comments are in this content class. Discuss this link is nested in links class. I need to move comments and "Discuss this" link under this "terms" class and that is, at least I think so, impossible this way.

Comments

AlexisWilke’s picture

Assigned: Unassigned » AlexisWilke

lion123,

Ah! Yes... The comments themselves are themed with one of the following functions:

    if ($mode == COMMENT_MODE_FLAT_COLLAPSED) {
      $comments .= theme('comment_flat_collapsed', $comment, $topic);
    }
    elseif ($mode == COMMENT_MODE_FLAT_EXPANDED) {
      $comments .= theme('comment_flat_expanded', $comment, $topic);
    }
    elseif ($mode == COMMENT_MODE_THREADED_COLLAPSED) {
      $comments .= theme('comment_thread_collapsed', $comment, $topic);
    }
    elseif ($mode == COMMENT_MODE_THREADED_EXPANDED) {
      $comments .= theme('comment_thread_expanded', $comment, $topic);
    }

I'm not too sure that I could make it specific to Discuss This! I guess I could re-implement the same themes and call the comment themes by default...

At the end, it calls another theme called comment_wrapper() as follow:

  return '<div class="discussthis">' . theme('comment_wrapper', $comments, $topic) . '</div>';

And as you can see, I just added a div with the class "discussthis" (should be there within 12h). If that is enough, then we're good. Otherwise, I will add themes for Discuss This! that you can overload in your theme. (isn't that sentence crystal clear?!)

Thank you.
Alexis

lion123’s picture

Thank you. It's easier to theme it now, but I still can't pull it out of the "content" class.

Here is the theme code in node.tpl.php:

  <div class="content">
    <?php print $content ?>
  </div>

  <?php if ($links): ?>
  <div class="links">
    <?php print $links; ?>
  </div>
  <?php endif; ?>

  <?php if ($terms): ?>
  <div class="terms">
    <?php print $terms; ?>
  </div>
  <?php endif;?>

Is there a way I can control "discussthis" class from here? Can i put them after "terms" class or between "links" and "terms"?

And just a small notice for a simple change :) It would be more logical to sort comments that are displayed in a node as "newest first". Because when you collect many posts, there is no sense in displaying first comments.

Thank you once more.

AlexisWilke’s picture

Good idea...

I mapped my development on to the Core and they actually attach the comments to the content block:

(see the $output .= comment_render(...) call)

/**
 * Generate a page displaying a single node, along with its comments.
 */
function node_show($node, $cid, $message = FALSE) {
  if ($message) {
    drupal_set_title(t('Revision of %title from %date', array('%title' => $node->title, '%date' => format_date($node->revision_timestamp))));
  }
  $output = node_view($node, FALSE, TRUE);

  if (function_exists('comment_render') && $node->comment) {
    $output .= comment_render($node, $cid);
  }

  // Update the history table, stating that this user viewed this node.
  node_tag_new($node->nid);

  return $output;
}

As far as I know, all we have to do is put the Discuss This! comment in another array parameter which is then transform in a theme variable... I'll have to investigate to make sure that's doable.

Thank you.
Alexis

dom.’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Module maintainer has changed. I'm closing this issue after years of inactivity, please open a new issue if needed.

dom.’s picture

Module maintainer has changed. I'm closing this issue after years of inactivity, please open a new issue if needed.