What would you think about a "Logic" field type that was not necessarily a visible field, but would allow an admin to insert code to handle the functions of a flexinode node? It could behave similar to how the nodeapi works and define different code segments for each type of event that happens to a flexinode. These fields would only be editable in the content type admin section and not necessarily visible to the user editing the node itself.
I could see this being useful if you had calculations that were made using existing flexinode fields or had a random piece of "view" logic that perhaps wasn't worthy of it's own module or even flexinode field, but nonetheless belongs with other flexinode fields. I think it would be a worthy endeavor, but just wanted to get others' opinions on it.
I suppose I've been drinking the flexinode kool-ade lately ;)
Comments
Comment #1
jonbob commentedInteresting ideas. I think the interaction between CCK and actions.module may allow something of this sort in the future; not going to code this for Flexi though.
Comment #2
javanaut commentedI started working on this field type, but quickly realized that I would need to significantly patch flexinode.module in order to invoke it properly. I would also have to define all possible event types and provide a means of specifying code for them. Since CCK is taking over, I decided just to wait and see.
What I envisioned wouldn't be as much of an external action to be triggered (though such a thing would be very useful), but instead a means of quickly coding a validation routine or generating some dynamic data on the fly or perhaps logging some statistics somewhere when a node is viewed under certain circumstances. The logic field environment would have intimate knowledge of the other fields in the node and could, for example, modify them or reject their submission based on arbitrary calculations.
I haven't had time to use the CCK for anything yet, but I could see me continuing to have a need for this type of feature going into the future. I'll probably implement this feature at some point if nobody else does, but my need is no longer pressing (I wrote a custom module to handle the features this field type would have done).
Great work on flexinode and CCK, btw!
Comment #3
Bèr Kessels commentedSounds like this can be achieved rather simple in a contributed field.Making it active again.