so i followed the my_blog tutorial on the elgg documentations and successfully made an elgg object. my question is how do i call that specific object's title globally? i'm trying this code out but it doesn't seem to work:
$blog = elgg_get_entities(array(
'types' => 'object',
'subtypes' => 'my_blog',
'owner_guid' => elgg_get_page_owner_guid(),
));echo $blog->title;
what am i doing wrong? i'm trying to write a plugin where there's an input box in a user's profile and the owner of the profile can only see this input box. i'm trying to populate that input box with the my_blog's title, i've tried descriptions and tags too but it doesn't seem to be working. btw that code is placed in views / default / profile / wrapper.php
i wish pulling data was just as easy as plugin settings via :
elgg_get_plugin_setting('plugin_value', 'plugin_name');
the only drawback to this code is that only admins can see this settings.
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
- Cim@manacim
Cim - 0 likes
- Team Webgalli@webgalli
Team Webgalli - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- Cim@manacim
Cim - 0 likes
- Cim@manacim
Cim - 0 likes
- lim@limdauto
lim - 0 likes
You must log in to post replies.#1 $blog = elgg_get_entities( gives back an array (many blogs!);) you then cannot do ->attr on the array !
#2 $user_setting_var = elgg_get_plugin_user_setting('user_setting_var', $user_guid, 'plugin_name');
handles user individual settings for plugins.
how do i get an individual subtype's object via title or metaname?
To get objects via metadata use elgg_get_entities_from_metadata()
which 'individual subtype' ?
@webgalli: he wants to use title (which is not metadata) as the predicate! what you're suggesting is different.
this seems to work for now
lets say i added a metadata called URL to a my_blog's entity. how would i call that specific metadata? by name?
Yes, $my_blog->URL would suffice.
But I suggest you take a look at elgg_get_metadata() function. It lets you get metadata from multiple sources.