How to programatically add a membership plan

1 reply [Last post]
mich
Offline
Joined: 11/09/2011
Status: 
Answered

Hi Leighton, 

right now i have a collection node type and lections that are referneced to the a collection node.

I want to programatically make a membership plan if a new collection node is created.

This is because there is user generated content and the users should have a simple form, not the big membershipplan-form.

I got this working, but whenever something changes with your form-function i have to recode this.

Is there a way to do this in a smarter way?

for example have a subset of the the membershipplan-form directly on a node?

 

Greetings, 

 

Axel

 

Leighton Whiting
Offline
Joined: 06/02/2009
Embedding portions of forms

Embedding portions of forms doesn't generally work well in Drupal. I suggest just putting the form elements you want on the form with a custom module, then creating the membership plan in the submit handler for the form. You can create it using drupal_write_record like the module does it.

Sincerely,

Leighton Whiting

Twitter Feed