Options to limit the number of item displayed in a views field
| Project: | NodeReferrer |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | DeFr |
| Status: | needs review |
Jump to:
Right now, if you add a Node Referrer field to a View, you can choose if the values returned by nodereferrer_view_handler_field::referrers should be displayed as a list or comma separated, but you don't have any control on the number of items that are displayed.
Such a setting can be usefull if you only want the field to display the last node that referenced a given node, instead of all of them.
Attached patch adds such a setting in nodereferrer_view_handler_field::options_form, and uses it in nodereferrer_view_handler_field::render to limit the displayed result.
Another approach would be to pass the maximum number of elements to retrieve all the way down to nodereferrer_referrers and use it as a LIMIT in the SQL-query: that would be a bit more efficient, but would make the patch a lot more invasive.
| Attachment | Size |
|---|---|
| allow-field-limit-form-setting.patch | 1.14 KB |

#1
Great addition!
Patch looks good for me. But I need more reviews to commit.