Hi, I need get all comments of a specific article, I'm trying with this but not work... :/
$comments = elgg_get_entities(array(
'type' => 'object',
'subtype' => 'comment',
'container_guid' => $gui_post,
));
Thankss!!!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- Cim@manacim
Cim - 0 likes
- Team Webgalli@webgalli
Team Webgalli - 0 likes
- sebastian@sebasellg
sebastian - 0 likes
You must log in to post replies.What is happening with that code? What results are you getting?
Are you sure $gui_post is a guid? Is it the container entity?
Also by default elgg_get_entities will only return 10 results, if you want *all* of them you need to disable the limit (not recommended).
Use egg_list_entities() instead and you can get that specific blog's guid right from the url
And you get something like this, I put the comments in the sidebar just for this example
Your code will fetch all the comments on the $gui_post entity. You have to iterate on those comments to output the data like,
Or, like cim mentioned, you can use the elgg's listing view if you use elgg_list_entities() instead
Hi, I tested the code but not work, return null, the var $gui_post equals '126' that is the guid of the article, I 'm doing something wrong ?.