By himagarwal on
Can comments of a particular content type be listed in a page with the user name and page where the comment was posted? Is there a module out there which can do this work?
Can comments of a particular content type be listed in a page with the user name and page where the comment was posted? Is there a module out there which can do this work?
Comments
You should be able to do
You should be able to do with with http://drupal.org/project/views. Set the view to filter for the content type you want, set another filter to be for number of comments greater than "0", and set the fields to be comment author, node title, and whatever else you want.
===
"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." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Thanks again. I think now
Thanks again. I think now it's time for me to start learning views, panels, CCK and taxanomy. I think it will at least take a week.........
meanwhile I used comments_page module which I chagned according to my need
I have created a conteny type called "product" and I only want to show comments from "product". Is there a way to add this in this module?
I'm no developer, but I
I'm no developer, but I think you could either add some SQL to the query (with something like WHERE n.type = '[your-content-type]') but i'm not sure exactly where in such a complex query.
Alternatively, you could enclose all the code in your while loop in an if conditional that tests for $node->type='[your-content-type]'. My only concern there, is that you will have to do a load node for each node id to test this condition-- depending on the size of $result, I would imagine that could be quite costly.
I'm totally guessing, but I would think doing it in the SQL has to be better performance wise.
===
"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." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
thanks.....tried adding
thanks.....tried adding n.type to the sql but don't know where to add.....anyways tried few places where I think it might work but it didn't. hope some help comes out.........
After looking at the query
After looking at the query again, i would think you need to change " WHERE n.status = 1 ORDER BY" to " WHERE n.status = 1 AND n.type = '[content-type]' ORDER BY"-- did you try that one?
===
"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." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Dude, you are genius. You
Dude, you are awesome. You are not less than a programmer........
It worked liked a charm.....thank you very much........
Well, not currently required but in case if I need to add more than one content type, is it possible?
*&$(#_(*%
lol, not hardly-- just an
lol, not hardly-- just an educated guess but you're very welcome. glad it worked.
and yes, you should be able to add as many content types as you want-- I think you just need to add "OR n.type = '[content-type]'" for each additional content type you want to add.
===
"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." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
thanks........one problem
thanks........one problem sorted out....severals to go but before I'll sit back for couple of days to learn cck+views.
I did it with views as
I did it with views as WorldFallz said. Though only I know basics currently, it was very very simple to set up. I wished I knew views earlier.
How can I change the theme (css) of the views I've created? Is admin/build/views/wizard is the only option?
And, is there any advanced video tutorial on cck, taxonomy, views and panels?
Thanks.
That's awesome!
That's awesome! Unfortunately, theming views isn't quite as easy as creating them, lol. There's some AWESOME videos on theming views as well as the using all the modules you mention over at http://drupaldojo.com-- unfortunately, the site's be down the better part of a week. IIRC, some of them are stored over at blip.tv-- you can probably find them searching with "drupal". Otherwise, just keep checking until the site is back up. I would browse all the videos there-- they're all good and they cover most must-know drupal topics. You can find some other good video repositories at Videos and slides.
And here's some links i found useful:
===
"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." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Thanks.
Thanks.
Is using Views Wizard a good option though I have to create .phptemplate, .tpl and .css file for every single view?
If you want to change the
If you want to change the structure yes-- and the first link above uses the views theming wizard. However, as with anything else on the web, if you just want to change appearance (and not structure), you can do some theming just with css.
===
"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." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz