lundi 30 mars 2015

Drupal forms api module - include value from parent node

I've written a simple module using the Drupal 7 forms API which adds a block to Drupal which can then be used on multiple nodes.


I'm a bit lost as to the best way to customise some of the values in (hidden) form fields based on where it's been included.


E.g. the module on the /articles/ may need to have a hidden value to say which mailing list they're signing up to, and the same form on /petitions/ may need a different value.


Is there a more elegant way to do this than using form_alter hooks?


Aucun commentaire:

Enregistrer un commentaire