Hi -
I am working on making a plugin so that users can 'like' widgets. For instance, a user would be able to like the photo album widget on another users' profile.
From a response to an earlier post (http://community.elgg.org/discussion/view/1495360/add-like-button-to-widgets-on-profile-page), I think that what I need to do now is to save the profile widgets as entities, because only entities can be annotated with likes.
Can anyone explain what I need to do to save each of the widgets on a users' profile as entities and then make it so that they can be annotated with likes?
Thanks very much!
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.
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- AlexGeorge2323@AlexGeorge2323
AlexGeorge2323 - 0 likes
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- AlexGeorge2323@AlexGeorge2323
AlexGeorge2323 - 0 likes
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- AlexGeorge2323@AlexGeorge2323
AlexGeorge2323 - 0 likes
You must log in to post replies.Widgets are already entities. I'm pretty sure all you need is to add a plugin hook handler for the "register", "menu:widget" hook and add the likes to the widget menu.
It looks like the widget menu is the menu that a site member sees when they edit their own widget settings. Is there another menu you're referring to that is registered that is what members' view on the widgets of other users? Or are you suggesting I start from scratch with the menu:widget and register a menu and a view with different access controls for viewing other members' widgets?
The menu itself is be visible to all logged in users. It's just the two particular items "delete" and "settings" that are hidden from others that the owner of the widget.
Add the like menu item in the plugin hook handler and it should work straight away.
Thanks for your help.
Can you send a link to where in the documentation the widget menu is listed? I can't find any documentation or code references to menu:widget.
I'm not sure we're talking about the same menu -- you're suggesting modifying the menu that has the default view of appearing in the settings icon of the widgets' owner?
See how it has been done in start.php of the likes plugin. It registers a plugin hook handler for 'register', 'menu:entity'. Do the same but register it for the 'register', 'menu:widget' hook instead.
Ah - ok - awesome - did that and it seems to've worked! Thanks again for your help.