Posted by davideads on September 30, 2008 at 6:29am
4 followers
| Project: | Nodequeue |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I ran into a problem, working on a recent project: I wanted direct access to the node objects for a specific nodequeue, to make custom theming easier. The way it stands now, you must either use a view or accept the rendered output provided by nodequeue_nodes().
This patch is a small rewrite of nodequeue_nodes(). It adds a helper function, nodequeue_fetch_nodes(), which returns an ordered array of the node objects for a given queue.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| fetch_nodequeue_patch.diff | 2.46 KB | Ignored: Check issue status. | None | None |
Comments
#1
Here's a better version of this patch, which properly enables random fetching, and drops display-related arguments from the fetch function signature.
#2
This sounds reasonable to me . Thanks for the revised patch - I hope to review this soon,
#3
This is definitely useful, it would be great seeing this integrated into the next release.
#4
hope to review and commit this this coming weekend. It does need some rerolling by someone, possibly me, to remove the lowercase 'true' changes that are unrelated to this patch.
#5
I finally got a chance to give this some attention.
The code here is solid but it seems like the function naming has the potential to be confusing. nodequeue_fetch_nodes returns loaded (but not rendered) node objects, while nodequeue_fetch_front, nodequeue_fetch_back and nodequeue_fetch_random return rendered node objects. Perhaps the fetch functions should be renamed nodequeue_load_front (and so on), nodequeue_nodes would then be renamed nodequeue_view_nodes, and nodequeue_fetch_nodes would become nodequeue_load_nodes. Then, when using the load (formerly fetch) functions, module developers could simple call node_view from within their modules.
What do you think?
Thanks for your interest and patience. I'll review any feedback (or rerolls) quicker this time ;).
#6
I made those name changes and did the related refactoring. Committed. Thanks!
#7
Automatically closed -- issue fixed for 2 weeks with no activity.