I need to create a custom index with custom blog posts view. How can I separately echo blog title, blog long text and blog tags on custom_index? Can anyone help with the code.
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.
- Team Webgalli@webgalli
Team Webgalli - 0 likes
- dadja.sam@dadja.sam
dadja.sam - 0 likes
- dadja.sam@dadja.sam
dadja.sam - 0 likes
- Trajan@Trajan
Trajan - 0 likes
- dadja.sam@dadja.sam
dadja.sam - 0 likes
You must log in to post replies.See : http://reference.elgg.org/entities_8php.html#af085c8362e49c4f52d4f1fcf58ca6fb8
then for each blog, echo $blog->metadata_name;
It does not work. It looks like $content array is empty.
$options = array(
'type' => 'blog'
);
$content = elgg_get_entities($options);
foreach($content as $result){
echo $result;
}
I got 2 blog posts. But I'm still can't fetch them.
Oh, this thing works:
$options = array(
'type' => 'object',
'subtype' => 'blog',
);
$content = elgg_get_entities($options);
foreach($content as $result){
echo $result->title;
echo $result->description;
}
try the following:
the above code will list the blogs using elgg's built in listing view. That way you don't need to define what the appearance is. It will save you some lines of code. :)
Thank you for advice. But my goal is to define custom appearance of blog posts. Trying to create community blog functionality with community posts on index.