Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 561063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:24:38+00:00 2026-05-13T12:24:38+00:00

im here with a nasty question. Drupal handle comments giving the user the choice

  • 0

im here with a nasty question.

Drupal handle comments giving the user the choice to display thems just in 4 ways: Flat list - collapsed, Flat list - expanded, Threaded list - collapsed, and Threaded list - expanded.

Im using the last one, whom provide a markup like:

<div class="comment">
    <!-- comment's content -->
</div>
<div class="indented">
    <!-- next comment is an 'answer' to the previous comment! -->
    <div class="comment">
        <!-- comment's content -->
    </div>
</div>

But i would like to have the ‘children’ comment inside the same dom element of the ‘parent’ comment.
So, for example, something like:

<div class="comment">
    <!-- comment's content -->
    <div class="indented">
        <!-- next comment is an 'answer' to the previous comment! -->
        <div class="comment">
            <!-- comment's content -->
        </div>
    </div>
</div>

in order to have a markup that allow me to show the threaded comments as this blog (using wordpress) does.

It use a markup like:

<ul>
    <li>
        <div class="comment>
            <!-- comment's content -->
        </div>
        <ul class="children">
            <li>
                <div class="comment>
                    <!-- comment's content -->
                </div>
            </li>
        </ul>
    </li>
</ul>

So, what is the drupalish way to do that (better if all the changes i need are in the template.php or templating files)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:24:38+00:00Added an answer on May 13, 2026 at 12:24 pm

    comment_render() seems to do everything internally. So you would need to rewrite this. Unfortunatly if you are using node_show() to render your nodes comment_render will be run automatically (not via an overridable theme function) so you will need to do quite a lot of work to get this to do what you want.

    Firstly you will have to use hook_nodeapi to convince drupal core that there are no comments (the talk module does this)

    function talk_nodeapi(&$node, $op) {
      switch ($op) {
        case 'load':
          if (talk_activated($node->type) && arg(0) == 'node' && !arg(2)) {
            // Overwrite setting of comment module and set comments for this node to disabled.
            // This prevents the comments of being displayed.
            $output['comment_original_value'] = $node->comment;
            $output['comment'] = 0;
            return $output;
          }
          break;
      }
    }
    

    Then you will need write your own implementation of comment_render (with nesting) and call that after the node is rendered (probably on your template page or in a preprocess function).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.