I'm trying to show the latest blog topics on the sidebar when a user is reading a blog. I'm using elgg 1.8.3. I tried copying to the file mod/blog/views/default/blog/sidebar.php the code below:
// blogs
if (elgg_is_active_plugin('blog')) {
echo elgg_view_module('featured', elgg_echo("custom:blogs"), $vars['blogs'], $mod_params);
}
this is what i get when i use that code:
The header for latest blog post shows, but it does not list the latest blog posts. how can i make this work?
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.
- rohonupe99@rohonupe99

rohonupe99 - 0 likes
- rohonupe99@rohonupe99

rohonupe99 - 0 likes
- rohonupe99@rohonupe99

rohonupe99 - 0 likes
- ghumanz@harinderghumanz

ghumanz - 0 likes
- rohonupe99@rohonupe99

rohonupe99 - 0 likes
You must log in to post replies.i fiured it out. in the file mod/blog/views/default/blog/sidebar.php i copied the code below at the end of that file:
$group = elgg_get_page_owner_entity();
if ($group->blog_enable == "no") {
return true;
}
$all_link = elgg_view('output/url', array(
'href' => "blog/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
'is_trusted' => true,
));
elgg_push_context('widgets');
$options = array(
'type' => 'object',
'subtype' => 'blog',
'container_guid' => elgg_get_page_owner_guid(),
'metadata_name_value_pairs' => array('name' => 'status', 'value' => 'published'),
'limit' => 6,
'full_view' => false,
'pagination' => false,
);
$content = elgg_list_entities_from_metadata($options);
elgg_pop_context();
if (!$content) {
$content = '<p>' . elgg_echo('blog:none') . '</p>';
}
$new_link = elgg_view('output/url', array(
'href' => "blog/add/$group->guid",
'text' => elgg_echo('blog:write'),
'is_trusted' => true,
));
echo elgg_view('groups/profile/module', array(
'title' => elgg_echo('blog:group'),
'content' => $content,
'all_link' => $all_link,
'add_link' => $new_link,
));
i have another issue. when i used the code above, i was able to put the latest blog topics in the sidebar for the groups, but when i click the blogs link in the menu bar at the top of the page that lists "All site blogs", the page is messed up now
anybody have any idea on how to do this???
Use this code it will display all latest blogs:-
thanks a lot! i really appreciate your help!