Is there any way to use views with CCK dynamic_field?
http://drupal.org/project/dynamicfield

Dynamic Field is a CCK field that returns a textarea where you can enter custom PHP code. The code is computed real-time.

The problem is: it doesn't sort by dynamic_field column.
May be it is because views sort data via sql-request, but dynamic_field computes its value in runtime.

Comments

dawehner’s picture

yes this is exact the problem.

it would just kill your site performance you have to load every node, and calc all fields

merlinofchaos’s picture

Status: Active » Fixed

dereine: thank you thank you thankyou for the fantastic work you're doing! When you answer a support request, can you either mark it 'fixed' or 'postponed (maintainer needs more info)' depending upon which you do? The vast majority of the time one or the other will be correct, and the submitter can change it back if they need further help.

(For example, this one is fixed =)

And on to the issue: Because the data is not in the database, Views cannot sort by it. Views does not support a solution of loading all records and then sorting.

dawehner’s picture

no problem i like fixing issues, but i'm not sure what status i have to use

karens’s picture

There are two solutions, depending on whether you want the result stored in the database or not.

1) Use computed field and choose the option to store the data in the database, Then you can do regular views on it.

2) Use Views Calc, which lets you create a field that will do dynamic totals using SQL, not PHP (you have to know enough about SQL to know how to define your value that way). This will work in Views.

merlinofchaos’s picture

If you think you've answered it, use fixed. If you were unable to answer it due to not enough information, that one's obvious. If you're not sure if yo'uve answered it but you've tried, use fixed and let the submitter know they can re-open it. If you couldn't really answer it at all and want somneone else's expertise, leave it active.

ARray’s picture

Thank you all!
I'll check Views Calc.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.