Hi, All :)
I have a question about custom_index. Ive used the code from the example custom_index plugin and it works perfect to show latest blogs, files etc... but I have to add latest pages.
so we're using this code to show blogs:
echo elgg_view_module('featured', elgg_echo("custom:blogs"), $vars['blogs'], $mod_params);
but with the print_r($vars) and some other tests I found that same code wont work to show pages, I need to add pages same way like they're in the profile page, if you'll add pages widget to the profile of course. So I went to the mod/pages/views/default/widgets/pages/content.php and grab some code from there, this is it with the little modifications:
$options = array(
'type' => 'object',
'subtype' => 'page_top',
'limit' => 4,//$num,
'full_view' => FALSE,
'pagination' => FALSE,
);
$content = elgg_list_entities($options);
echo elgg_view_module('featured', elgg_echo("custom:pages"), $content, $mod_params);
It shows me pages, but it different from the look that I have on profile page, it adds some admin links into each page (text links: public, history, edit and graphic buttons: rate, delete), like its look when you go to the "pages" page. I believe that this is something in the $options, but I don't understand why this code have different look on profile page and on my custom_index page.
Maybe somebody can help me with this?
Thanks in advance!!! :)
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.
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- ProToha@protoha
ProToha - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- ProToha@protoha
ProToha - 0 likes
You must log in to post replies.$options = array(
'type' => 'object',
'subtype' => 'page_top',
'container_guid' => $vars['entity']->owner_guid,
'limit' => $num,
'full_view' => FALSE,
'pagination' => FALSE,
);
$content = elgg_list_entities($options);
echo $content;
thank you for the answer, DhrupDeScoop!
but this doesn't fix my problem, at first of course I got the full code from the file I mention in the first message, then played a lot with this - deleted owner and changed $num to 4, but whith this or without it shows
(text links: public, history, edit and graphic buttons: rate, delete)
over each page anyway, but I need to show it just like its look on the profile page, the same, but without these links and buttons, so it will look like blogs, bookmarks and other stuff in the custom_index. Maybe there're some other strings which I can add to $options?
add elgg_push_context('widgets'); before and elgg_pop_context(); after your code
Ismayil Khayredinov, thank you, thank you, thank you!!!!!
it works perfect now!!
Thank you! :)