Closed (fixed)
Project:
Node Relativity
Version:
5.x-1.x-dev
Component:
User interface
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Mar 2007 at 22:22 UTC
Updated:
28 Mar 2007 at 11:04 UTC
Consider this scenario:
Parent node = "The Book"
Children = Chapter 1, 2, 3, 4, ...
Each chapter node type has a word count CCK field which keeps track of number of words (duh! :) How can I sum up the number of pages? ie. aggregate data from many child nodes?
I need this for current page count... Or would you consider a different approach? Maybe a hidden variable in the parent node?
Please advise. Thank you!
Comments
Comment #1
JohnG-1 commentedviews calc module ?
http://drupal.org/project/views_calc
Install Views Calc module.- Build a view that lists all the pages you want to include.
- Add the wordcount Field to the view.
- Set the View Type to Calc Table View.
- Then go to View Calc settings (admin/settings/views_calc)
- Enable calculations for your new view.
- Configure Fields (tab) ... set the wordcount column to Sum.
- Admire your work :)
Is that any good ? or were you after something a bit more elagant ?
Comment #2
andrew7 commentedThank you John,
Quite a creative and practical solution... Would you happen to have a suggestion for storing the count/sum within the parent node itself?
Anything with computer_field come to mind?
Thanx again. Cheers.
Comment #3
owahab commented