I would like to insert some php code for the Default Value of a CCK select list which will query the database and return the appropriate array and build the select list. Can this be done or will this require a custom module?
Background
I have been working on an idea for my school's web site to allow teachers to post homework assignments for each of their individual classes as a custom content type called Homework.
I installed the BIO module to get additional information about each teacher. On the bio page, teachers have the opportunity to fill out a form with their name, grade level, course(s) taught and the name of each of their classes - which are text fields and are nicely stored in the database as separate records. What I want to do is present a drop down menu (multiple select) to the teachers on their "post homework" node. The teacher will choose to which class(es) the assignment will be given by making the appropriate selection from the menu.

Alternately, parents will be given a page view of the homework content based on the selection of the correct grade level, course, teacher name, and the name of the class the teacher which the teacher entered on his/her bio page/node (all this information actually comes from the bio node).

Can this be done this way?

Thanks for any advise!

Comments

bartezz’s picture

Have you succeeded in doing this?

Cheers

________________
Live fast die young