I want to add a "Latest videos" widget on widget manager custom index. Problem is that I managed to create the widget but it does not display any latest videos. The videos plugin I'm using is Webgalli's "videos"
What I did was to create "index_videos" folder in widget_manager\widgets\ and then a "start.php" file in \widget_manager\widgets\index_videos. The content of the \widget_manager\widgets\index_videos\start.php file is the following:
<?php
/* init file for index_videos widget */
function widget_index_videos_init(){
if(elgg_is_active_plugin("videos")){
elgg_register_widget_type("index_videos", elgg_echo("videos"), elgg_echo("widget_manager:widgets:index_videos:description"), "index", true);
elgg_register_plugin_hook_handler('widget_url', 'widget_manager', "widget_index_videos_url");
}
}
function widget_index_videos_url($hook_name, $entity_type, $return_value, $params){
$result = $return_value;
$widget = $params["entity"];
if(empty($result) && ($widget instanceof ElggWidget) && $widget->handler == "index_videos"){
$result = "/videos/all";
}
return $result;
}
elgg_register_event_handler("widgets_init", "widget_manager", "widget_index_videos_init");
In fact what I did was to copy paste the index_bookmards folder and its start.php file and replace "bookmarks" with "videos". The result is that a videos widget appears on the widget selection screen but when selected it does not display the latest videos.
Any help would be appreciated!
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.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Michalis@MichalisCy
Michalis - 0 likes
You must log in to post replies.Now copy&paste (and edit then) this part:
Thanks, that works great!! Thank you for your help!!