How can i use Feedback_Simple Module to open the contact form with the Modal_Forms Module http://drupal.org/project/modal_forms

CommentFileSizeAuthor
#3 feedback_simple_modal_forms.zip1005 bytesseandunaway

Comments

seandunaway’s picture

Status: Active » Fixed

To add the required classes just do something similar to:

/**
 * Implements hook_preprocess_feedback_simple().
 */
function MYMODULEORTHEME_preprocess_feedback_simple(&$variables) {
  // Add modal_forms classes.
  $variables['class'][] = 'ctools-use-modal';
  // Uncomment either small, medium or large.
  $variables['class'][] = 'ctools-modal-modal-popup-small';
  // $variables['class'][] = 'ctools-modal-modal-popup-medium';
  // $variables['class'][] = 'ctools-modal-modal-popup-large';
}

If you write it in a custom module please contribute it back here.

A similar thread (for working with modal module) is: #1245908: how to use with automodal class?

Babalu’s picture

where i have to put the code ?

seandunaway’s picture

StatusFileSize
new1005 bytes

It goes into a custom module...

Here I put it in a module for you... just download and unzip to your modules directory and enable.

Babalu’s picture

perfect, thank you rump

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

utneon’s picture

Category: support » feature
Status: Closed (fixed) » Needs work

I created a custom module using the module example code with admin settings and some extra features. What do you think about contributing back my custom module as a sandbox project for Feedback Simple Modal Forms?

seandunaway’s picture

Sounds good :)
I'm not opposed to including integration with these other modules (modal forms, automodal, etc) as submodules in this project!

utneon’s picture

do you have a project and git repository already created for this project? I can't find the project page

utneon’s picture

sorry rump, my bad, only noticed now that you're the maintainer and creator of feedback simple. Yeah creating submodules por feedback simple makes sense. I have a suggestion, add this modal forms integration as well choosing the path of the feedback simple button in the admin settings.

seandunaway’s picture

Status: Needs work » Needs review

Can you verify the above module/code is still working properly? If so, I will commit it.

We already have another issue for admin settings.

seandunaway’s picture

Status: Needs review » Closed (duplicate)

Actually, now that I think about it.... All we need to do is add a classes field in the admin settings where people can type in ctools-use-modal.

I'll include this functionality in the other issue: #1407784: Add admin settings to change the image and destination URL

utneon’s picture

rump yes it is =) add a checkbox that adds that class automatically so people don't need to enter that specific class manually and add another field for custom classes. Add some php regex validation for security:)

mfoda’s picture

Have been trying to get this to work with modal_forms V7.1 for the past couple of hours with no luck. Installed and enabled the patch in #3, enabled modal forms for contact page, and I'm still getting and HTTP Ajax error. How did you guys get it to work?

basik.drupal’s picture

I'm also getting this error

kbrinner’s picture

There is a similar conversation about this error happening at http://drupal.org/node/1651226

seandunaway’s picture

The attached module in #3 used to work but is depreciated now.

Now that we had the admin settings with a class field, you can just input whichever classes are required for whichever modal module you're using.

For example:

ctools-use-modal

and one of:
ctools-modal-modal-popup-small (300x300)
ctools-modal-modal-popup-medium (550x450)
ctools-modal-modal-popup-large (80%x80%)

Also I think its probably important to acknowledge the Support Forums on the Automodal page:


Supported forms

Log in (modal_forms/nojs/login)
Request new password (modal_forms/nojs/password)
Create new account (modal_forms/nojs/register)
Contact (modal_forms/nojs/contact)

THE GIST:

The module in #3 is depreciated.
In Feedback Simple admin settings, try setting the class field to: feedback_simple ctools-use-modal ctools-modal-modal-popup-medium and the link field to modal_forms/nojs/contact