tags:

views:

309

answers:

2

hi,

can I add a CCK image field to another CCK field ? I would like to add icons for each item i add. At the moment I can only write the description.

This would be very cool functionality!

+1  A: 

You could do this with JQuery if you want to add an icon by file type. For example see http://www.webdesignerwall.com/tutorials/jquery-tutorials-for-designers/ tip #10.

If you want to be able to specify an icon per item added (so it could be a different icon for every added item) then how you do it depends on how you are displaying it.

So lets say each CCK field is being added to a particular node type and you have a view that lists those nodes then I'd recommend adding a CCK image field to the node (so that each node of the required type has the descriptively named CCK image field and the original CCK field) and then adding a custom template to the view that controls how the image and field are output relative to each other.

I was about to write an example of how to do that but thought I'd check if that describes your needs before I add unnecessary info to the response.... can you clarify what you're trying to do?

Paul D'Ambra
yeah it is clear. But I like to use nodes for projects and CCK fields (with multiple items) . When the project is removed, the items are automatically removed. My customer can easy remove, add and drag and drop the images to change the order. Using a node for each item is not that easy for my customer anymore...
Patrick
A: 

You can do this using CCK 3.0's multigroup functionality. Note that there is no stable release for this branch, but it seems to work fine for most use cases.

You would add an image field (icon) and a text field, into a multigroup, and then when adding a new node, instead of the traditional 'add another' button, there is a button to add another group of associated fields.

jhedstrom

related questions