how to attach hidden CCK fields to the node

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

Hi folks.

I'm about to create a simple module – I've named it nodegift. It allows admin to choose any content type and use all nodes of chosen content type as a “gift”. See mockup.
How it looks from users point of view: User seeing the “gift” node. Each node is having a different “price” (userpoints). If user having enough points and may “buy” current node – it clicks on buy button, choose username of the person he/she wants to make gift to and buying current node. Gift receiver then may see this node in his/her profile (maybe in a block, etc.... going to define a view to display gifts for gift receiver).

For now, all nodes of gift type must has 3 fields – 2 userreference fields to hold gift sendeer and receiver id and 1 number field to hold gift price. my module hides userreference fields in both node edit form and node view. This is because I'm using it for internal purposes (to hold receiver and sender ids). These 2 fields should available in views filters selection, however.

I'm wondering is it possible to modify my module so it will create 2 hidden CCK fields (actually I want it to be a userreference fields) a 1 visible field – buy button?

AttachmentSize
auto_cck_fields.png55.67 KB

Comments

Contemplate

wayland76@drupal.org's picture

Another way of doing is to use the contemplate module.

Thank you all, guys, but

drupalprojects's picture

Thank you all, guys, but I've decided to get rid of CCK hidden fields in my module.
You can check it on http://drupal.org/project/nodegift

Content Construction Kit (CCK)

Group organizers

Group notifications

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