Opened 5 years ago
Closed 5 years ago
#63 closed Documentation (fixed)
Document pagination for plugins
| Reported by: | misja | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Core | Version: | 1.0 |
| Severity: | major | Keywords: | |
| Cc: | brettp | Difficulty: |
Description
Basically, I've added a couple of functions that automatically list items and paginate through them in an intelligent way. That means you don't need to worry about counting offsets or any of that crap: one line and you're done. On Pete's advice, it adds simple text links to the top and bottom of a listing; obviously, as with anything, any plugin is able to change the pagination structure. (The view is navigation/pagination.)
For example, I've committed this in the blog plugin user blog page:
$area1 = list_user_objects($page_owner->getGUID(),'blog');
On the friends page:
$area1 = list_user_friends_objects($page_owner->getGUID(),'blog');
On the 'everyone' page:
$area1 = list_entities('object','blog');
It's simple stuff. There are also listing functions for deeper functionality like search on metadata, so for example, search/index.php calls:
$body = list_entities_from_metadata("", $tag, "", $subtype);
Change History (2)
comment:1 Changed 5 years ago by misja
comment:2 Changed 5 years ago by ben
- Resolution set to fixed
- Status changed from new to closed
Et voila - list_annotations etc are now available for use.

This should also include annotation listing via elgg_view_annotation_list and list_annotations.