I am very new to elgg so it may be I am doing it completly wrong. but I am trying to do:
$ting = elgg_list_entities(array('type' => 'object', 'subtype' => 'form', 'form_id' => '24', 'limit' => 4, 'full_view' => FALSE, 'view_type_toggle' => FALSE, 'pagination' => TRUE));
What I was hoping this would do is list the 4 latest made by the form with id 24 in my custom frontpage when I echo $ting. is this a totally wrong way to do it? it has worked on other plugins I have tested.
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.
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- proteque@proteque

proteque - 0 likes
- proteque@proteque

proteque - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- proteque@proteque

proteque - 0 likes
- proteque@proteque

proteque - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- proteque@proteque

proteque - 0 likes
You must log in to post replies.Is this a custom form (as opposed to user or group profiles for example)?
If so, the subtype should be form_data.
Also, form_id is a piece of metadata so you have the wrong function call. Use elgg_get_entities_from_metadata.
or list_entities_from_metadata
thank you. will test and give feedback :)
thank you. this did the trick. :)
it was a custom form so I was using the wrong subtype. however it did work like I hoped with elgg_list_entities even with the metadata. was that pure luck and random? is list_entities_from_metadata what I really should be using?
Yes. I expect that it works because it just happens to find the correct data (maybe because it was the latest form_data added?)
yes it was the latest form added. thank you for pointing this out for me!
however I only get the feedback "array" with elgg_list_entities_from_metadata. Tried looking around and found it was done in another way then.
so I tried
elgg_get_entities_from_metadata(array('metadata_names' => 'nyheter', 'subtype' => 'form_data', 'limit' => 4, 'full_view' => FALSE, 'view_type_toggle' => FALSE, 'pagination' => TRUE));
where nyheter is the name of the newest form_data. I also tried with the id 24
got empty feedback.
tried using type instead of subtype as well btw as some examples showed.
This is really a question about the basic Elgg API, not the form plugin.
I think if you just use
list_entities_from_metadata('form_id', 24, 'object', 'form_data', 0, 4, false, false);
you should get what you want.
okay. sorry for asking in wrong thread then. but thanx for answering me anyway :)
(your answered did the trick btw in case anyone else stops by and wonders)