Can I just simply make "Recent Comments" show up in a node? Like the way it's displayed in a block. Just want its content, where the links show up with the user name etc in Recent Comments.

Can I put this in a node and how? I looked at the source and I copy and pasted it into node but nothing happened.

Can you please tell me which part of the source code I need to make this work. Thanks.

Comments

WorldFallz’s picture

Probably the easiest way to do it would be to use the views module and create a page view of recent comments the way you'd like them to appear.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

forumer’s picture

I know this can be done easy with modules. But was wondering if it was possible with a little code work without any modules.

Is it possible?

WorldFallz’s picture

Yes its possible to code directly into a page. Maybe one of the snippets at http://drupal.org/handbook/customization/snippets might be helpful.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

forumer’s picture

Couldn't make anything out of the snippets.

What I'm asking to do, does it involve php? Because I don't see any php in the source code.

This is what's the source code looks like for Recent Comments:

<div id="block-comment-0" class="clear-block block block-comment">

  <h2>Recent comments</h2>

  <div class="content"><div class="item-list"><ul><li class="first last"><a href="/node/241#comment-1">hello</a><br />9 hours 14 min ago</li>
</ul></div></div>
</div>
        </div>
      
    </div> <!-- /container -->

  </div>

I pasted that into the node hoping to get an indication that I was on a right path. But none.

WorldFallz’s picture

Yes-- it's going to require both php and sql. SQL to pull the comments out of the db then php to print and format them with html. What you've pasted above appears to be be output without any of the sql and code that created it.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz