Definitely feasible, there is a hook for 'object', 'create' you can use to alter the blog/file/whatever at the time of creation and tag it (either as a real public-facing tag or by hidden metadata)
The important thing here is establishing a way to tell that it was created in a 'module' - most easily accomplished by setting a session variable when the user enters the module and removing it when they leave. If the session variable exists when you inspect the object created then you tag it, otherwise leave it alone.
Matt! Once again I am in your debt! I built a quick proof of concept and this will work exactly like I want...
Thanks again!
I want to return all blog postings by users who belong to the group mygroup and who have tagged the blog entry with mytag
Note: this can be interpreted as 'blogs within a group' or 'blogs anywhere posted by members of a group' - and those are two different things. I'll assume you meant 'blogs within a group'.
$options = array(
'type' => 'object',
'subtype' => 'blog',
'container_guid' => $group->guid, // this is what limits the search to this group,
'limit' => 10, // or however many you want, false for all of them, but not recommended
'metadata_name_value_pairs' => array('name' => 'tags', 'value' => 'mytag'), // limit to a specific tag
);
Matt - Thanks so much!!! That really helped!
Cheers,
Rich.
OK, so I'm getting further into the nittygritty of my plugin and I'm stumped again! I would like to be able to filter blog entries that contain ALL of a certain subset of tags.
For instance, I want all blog posts that contain BOTH 'tag1' AND 'tag2'.
I've been filter on 'tag1' OR 'tag2' but I'd like to filter on 'tag1' AND 'tag2'.
I'm wondering if there is an easy way to do this?
Thanks!
Rich.
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.