[support] [views] build a list of users associated with a node (cck userreference)

Nicolas Tostin nicolast at logis.com.mx
Tue Oct 7 16:16:37 UTC 2008


Hi everybody,
I'm evaluating views 2 and the option to build views of users (it's
important to stay with this setting for the last part).
I couldn't find any way to retrieve the users referenced in a node (thanks
to CCK userreference module), there's no relationship available for "user
view" so I don't know how to restrics my users.

Here is the example I'd like to create.
- I build a "classroom" content which reference a teacher and many students.
- the teacher will create an "exam" content which give a result (A, B, C...)
to a student (user reference field: field_exam_student)
I'd like to restrict the field_exam_student to only student which are in the
same "classroom" as the teacher (to prevent the teacher capturing exam
result for other students).

Doing this in SQL in fairly trivial, but userreference doesn't have a "php
code" field for allowed values, so I'm stuck with using views to restrict my
field (user view) and haven't been able to make it.
Is there a way to create such a view ? Do I have to write a custom module to
make my field_exam_student available in a relationship ?

Thanks a lot for your answers. I hope I was clear enough.
Regards



More information about the support mailing list