By ofridagan on
Hello,
I have a computed filed that I want to display in a view.
I understand I can only do that when storing th field in the database, and that's fine.
However, I need to trigger the computation of the field when the view is built, because the parameters for this calculation can change regardless of its node (the computed field is based on other nodes).
How can I do this?
I will appreciate any help, including a general direction for writing a new module for that.
Thanks!
Comments
Sorry, posted on the wrong forum before
Sorry, posted on the wrong forum before
Any help will be appreciated
I am trying to look at the views API docs, but I'm lost with all the hooks and handlers.
Could someone please put me in the right direction, of how for example I can cause the computed field to re-compute when a view is built?
Thanks.
Can you give me a more
Can you give me a more specific use case? I'm having trouble understanding the parameters of your calculation.
If the "computation" is based on other nodes, then you should have a relationship in your view which might give you what you want.
Thanks!
I have a node with three fields: node-reference (x), a number (y) and a computed field.
The computed field is the sum of y and another number field inside the node that is referenced by x.
Actually I'm not sure I understand relationships... I can't believe I missed this... I will try to figure it out.
Thanks!
OK
Ok, I get the relationship thing... it will let me use a field of the referenced node in a view showing the original nodes, for example.
This is cool! but does not give me exactly what I want.
Let me try and be more clear about what I need:
All I really need is to have a column on a view showing some kind of a calculation on the other columns (fields).
I tried doing this with a "computed field" but maybe it's not the right way to go...
Please help!
keeping alive...
Still haven't got the right answer.
Am I not making any sense?