Exploring the possibilities and the limits of CCK

Events happening in the community are now at Drupal community events on www.drupal.org.
julma's picture

It could be a good idea both to show the interest of using CCK and to have a clear idea of what still need to be improved in CCK.

So if you want to comment on this thread, either you can take an example of form on the web and explain how you would be able to reproduce it with CCK or on the contrary you can take an example and explain why it is impossible or difficult to do it with CCK.

Who want to play that game ?

Comments

I have 2 situations which I

jamestombs's picture

I have 2 situations which I don't think are possible, if they are I would love to know how.

First:

If you have a node reference CCK field but want 4 different results, it isn't possible. The user is able to select 4 identical nodes from the each autocomplete box. The only alternative is to use the multi select box which really isn't intuitive enough for the average user. Ideally I would like to use select lists, but the only way of doing that is to have 4 seperate CCK fields, all node references, but again all 4 are allowed to be duplicates.

Second:

Back with the node reference CCK. The node that is being looked up has a CCK field with a decimal cck value in it. I want it so that the user has a certain amount of points and can only use that much points. Lets give the user 100 points. So if from the first select box they select a node with a value of 10, they then have 90 points left to use for the rest of the node references. If they try to select more than the points available either halt their progress there and then or wait until the form has been sumitted to alert the user of the problem.

Neither of these as far as I can see are possible. I have tried as much as possible in Drupal 6 using Views and CCK.

James Tombs

re: node reference with 4 different results

dwees's picture

The secret here is to use jQuery and a custom theme to handle this case and/or add custom validation to the form using hook_nodeapi with op = 'validate'. Then you can add whatever validation you want to your form (like preventing all 4 fields being equal for instance, or any 2 fields being equal).

Dave

I hadn't thought of that.

jamestombs's picture

I hadn't thought of that. Just looked it up in my book and I haven't read the jQuery chapter yet. Thanks for the heads up on it.

James Tombs

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: