I'd like to count the number of nodes that the node might reference as well as the total number of nodes referencing that node - all together. How can this be accomplished?

Comments

gilgabar’s picture

Nodereference count will give you the number of nodes referencing a given node.

The number of nodes that particular node references can be found in the node object. Make sure devel module is installed and do a dsm($node) from someplace where the node object is available (node.tpl.php is probably a reasonable place) and then you can drill down into the node object and find your node reference field. You should be able to do a count() on that array to get the total number of references.

To get the grand total of those two things just add them.

gilgabar’s picture

Status: Active » Closed (fixed)

Marking this closed, please re-open if that didn't answer your question adequately.

Nicolas Bouteille’s picture

Category: support » feature
Priority: Normal » Minor
Status: Closed (fixed) » Active

Hi,

I personally don't need this right now but I read the request and I think even though I agree that the php solution is pretty simple, it would be nice to provide the feature. Don't you think?
Switching this to a minor feature request.