Option in views to only display the number of referrers node ( count the child node of a cck node and display the number )
schibou - March 28, 2009 - 01:49
| Project: | NodeReferrer |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
I needed to display the number of referrers node for some cck node in a page that I was creating using a view.
I used this module to link the referrers node but I only needed there number, not a list of them.
So I edited: nodereferrer_view_handler_field.inc to add a drop down menu to enable this feature.
I get it to works but it's not nicely integrated at all so, if someone else want this feature ported into the module, it will be nice to have it in a final release.
(Still I've put my modified nodereferrer_view_handler_field.inc file for the 6.x-1.x dev and the patch with this request)
| Attachment | Size |
|---|---|
| nodereferrer_view_handler_field.patch | 9.39 KB |
| nodereferrer_view_handler_field.inc.zip | 1.54 KB |

#1
Good idea so need work to make more configurable
#2
I would need this but cannot provide code.
#3
@mansspams try code provided by @schibou
#4
@mansspams the patch work's for me, you can try it.
#5
installed module, applied patch (replaced file from zip to be precise), added cck field, adjusted display (no count possibility there), tested how node looks, yes, nodes that refers to one i am looking at are displayed, so far so good. but in views i cannot find NodeReferrer field under content and got stuck there. I wonder what did i do wrong.
#6
Hum I don't know why, maybe some chages in recent versions that make it obsolete.
It was not ported into the module (since it was just a one time application), sorry it didn't work for you.
#7
@schibou try to make a patch against current HEAD, I've made some cleanup
This feature is great! I glad to include this into upcoming release
#8
i found the problem. i was looking under content but it is under node, so yes, @schibou patchs works and you may include it in future releases. thanks guys!
#9
one more review?
#10
I would really need this functionality as well, thanks for the patch.
#11
After applying the patch the feature works properly for me. Thank you.
#12
I'm interested in this functionality. How would I go about applying the supplied patch?
#13
@caschbre try docs at http://drupal.org/patch/apply
#14
Requested filter to list nodes without referrers #582034: Integrate referrer count in views2
Suppose we need filter and formatter. Filter in count expression and formatter to display counts
#15
looks like the OP patch does not apply to nodereferrer 6.x-1.0-beta2 dated 2009-09-22
#16
Might be that the patch doesn't work, but just copying nodereferrer_view_handler_field.inc into its place worked for me.
Thanks for this great feature. I used to make a forum with discussions with content types and views2.
I suggest you turn this feature into a separate field, enhances usability in my opinion.
#17
Glad to commit if someone provide a patch against DRUPAL-6 but not replacing existing features
#18
I'm afraid my php skills aren't sufficient to make a decent patch, but I'd love to help out in any way I can.
As I suggested above I'd prefer this feature in a separate handler: nodereferrer_view_handler_field_count.inc. This new handler should extend views_handler_field_numeric instead of views_handler_field since we are dealing with a numeric field.
andypost: I see that you've split up the handlers (nodereferrer_view_handler_field.inc, nodereferrer_view_handler_field_field.inc and nodereferrer_view_handler_field_type.inc), but I don't understand why? I don't know how much of the code should go into the new handler, since I don't really get what's going on in the code. Could you somehow lead me in the right direction?
Thanks
Marcus