CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • drupal formsapi
Pages: [1]

Author Topic: drupal formsapi  (Read 1682 times)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
drupal formsapi
September 15, 2008, 08:15:29 am
I've just been struggling with customizing a public CiviCRM profile form. Typically, the forms generated by CiviCRM profiles aren't quite what the client wants, so I often use the standalone mechanism to create a static drupal page with the standalone version of the form and then mangle it. Three problems with this approach are:

1. I can't use either the civicrm captcha or the drupal anti-spam form mechanisms (captcha or mollom) to protect the initial form.
2. I can't customize the form with any functionality using drupal's formapi methods (hook_form_alter or form theming)
3. The form handling page is the civicrm-generated form, which means I loose the standalone customizations on any form-handling (yes, I could manually code some javascript to do it all there...).

I suspect I might be just missing some information here to solve some of these issues, but being drupal-biased, I really, really just want to manage these forms using drupal. So I think what I want is to use the civicrm api in a custom drupal module that converts civicrm profile forms into drupal forms.

1. has anyone already done this?
2. does this make sense to anyone else?

 - Alan


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: drupal formsapi
September 15, 2008, 08:30:25 am

1. If its just look and feel customizations, you can customize that pretty easily with custom templates

2. I think 2.1 will make extending forms and adding your own stuff a bit better. We've added hooks to all the steps of the form processing logic, so you can insert elements (then display them with a custom template etc), validate and process them etc. However u'll still need to do this using QuickForm or some CiviCRM helper functions

theoretically, i do think its possible to map QF and drupal form api. IMO building that might not be worth the time and effort

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: drupal formsapi
September 16, 2008, 04:58:18 am
okay, thanks. I'll try the custom smarty template approach.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • drupal formsapi

This forum was archived on 2017-11-26.