Hi,
I've been thinking about the implementation of editing CCK fields using Workflow-ng. As a non-developer I can't say much about the code, but I was thinking on the way it should be done, which is also something ;)
I took some ideas from the custom pager and imagecache module. Attached a snap with the two sections of these modules as an example.

The action will be with the following fields:
Select nodes to be edited
By PHP snippet or by Views (and views arguments) – This allows for even non-developers to use A views query to return which nodes should be changed. This is taken from custom pager.

Select fields to be edited
This section gets a button and 2 parameters :
1. Button to create a new field-action. Options are to ‘Add value to field’ (in case of multiple values) or ‘Replace value in field’. In the future other actions can be there (Delete value from field for example). This is taken the imagecache module.
2. Name of filed.
3. PHP section to enter the value

Fago, what do you think about this idea? is this the right track to implement this?
I think such a feature will be a killer! ;)

Cheers,
Amitai

CommentFileSizeAuthor
Amitai.jpg53.83 KBamitaibu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

yep, that sounds neat!

What I've also planned for workflow-ng, is to make it possible for conditions to expose further arguments. Then the "node getting part" could be written as condition "are these nodes available?", which can be used by possible any action. But for now, that's not possible so it has to go into the action.

Then to the way to set the field value, it would be nice if the action could display the field form, so one could select the value as normal. But to make more sophisticated values (changing values!) possible, it would be probably best to let people specify php code too (like the cck default value option) - ideally including the possibility to use token replacements.

mitchell’s picture

Component: Code » Wng Module Integration

"Populate a cck field" exists in Rules.