You are here

README.txt in Modal forms (with ctools) 7

@codingStandardsIgnoreFile

CONTENTS OF THIS FILE
---------------------
   
 * Introduction
 * Requirements
 * Installation
 * Configuration
 * Supported forms
 * Links to the modal version of the forms
 * Webforms
 * Maintainers


INTRODUCTION
------------

Modal forms make use of the modal feature in the ctools module to open some
common forms in a modal window.


REQUIREMENTS
------------

This project requires the following:

 * Chaos tool suite (ctools) (https://drupal.org/project/ctools)

INSTALLATION
------------

Install as you would normally install a contributed Drupal. See:
https://drupal.org/documentation/install/modules-themes/modules-7 for further
information.


CONFIGURATION
-------------

 * Go to Configuration » Development » Modal forms to find all the configuration
   options.

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)
* Comment (modal_forms/nojs/comment/reply/%node)
* Webform (modal_forms/nojs/webform/%node)

Function that rewrite normal links to modal forms links (except for webforms)
can be activated on the modules configuration page.


LINKS TO THE MODAL VERSION OF THE FORMS
---------------------------------------

JavaScript that can rewrite standard links to these forms in to a modal
equivalent are provided, see the module configuration page to activate them.

To build links in code I recommend using the ctools_modal_text_button() function

$links[] = ctools_modal_text_button(t('Modal Login'), 'modal_forms/nojs/login', t('Login via modal'));
$links[] = ctools_modal_text_button(t('Modal Login'), 'modal_forms/nojs/login', t('Login via modal'),  'ctools-modal-modal-popup-small');

It is also possible to build links manually.

<a class="ctools-use-modal" href="modal_forms/nojs/login">Modal Login</a>
<a class="ctools-use-modal ctools-modal-modal-popup-small" href="modal_forms/nojs/login">Modal Login</a>

Popup styles and sizes:

The include CSS file tries to mimic the default Colorbox style.

The extra class "ctools-modal-modal-popup-small" in the links above tells the
project what popup style size to use. There are three options included.

* ctools-modal-modal-popup-small (defaults to 300x300)
* ctools-modal-modal-popup-medium (defaults to 550x450)
* ctools-modal-modal-popup-large (defaults to 80%x80%)

Go to the configurations page for Modal forms to adjust the sizes.


WEBFORMS
--------
There is support to open webforms in a modal by constructing special links.

A webform link should look like this one:

<a class="ctools-use-modal ctools-modal-modal-popup-large" href="/modal_forms/nojs/webform/[nid]">Link to click</a>

Replace [nid] with the node id of your webform.


MAINTAINERS
-----------

Current maintainers:
 * Fredrik Jonsson (frjo) (http://drupal.org/user/5546)
 * Renato Gonçalves (RenatoG) - https://www.drupal.org/user/3326031

File

README.txt
View source
  1. @codingStandardsIgnoreFile
  2. CONTENTS OF THIS FILE
  3. ---------------------
  4. * Introduction
  5. * Requirements
  6. * Installation
  7. * Configuration
  8. * Supported forms
  9. * Links to the modal version of the forms
  10. * Webforms
  11. * Maintainers
  12. INTRODUCTION
  13. ------------
  14. Modal forms make use of the modal feature in the ctools module to open some
  15. common forms in a modal window.
  16. REQUIREMENTS
  17. ------------
  18. This project requires the following:
  19. * Chaos tool suite (ctools) (https://drupal.org/project/ctools)
  20. INSTALLATION
  21. ------------
  22. Install as you would normally install a contributed Drupal. See:
  23. https://drupal.org/documentation/install/modules-themes/modules-7 for further
  24. information.
  25. CONFIGURATION
  26. -------------
  27. * Go to Configuration » Development » Modal forms to find all the configuration
  28. options.
  29. SUPPORTED FORMS
  30. ---------------
  31. * Log in (modal_forms/nojs/login)
  32. * Request new password (modal_forms/nojs/password)
  33. * Create new account (modal_forms/nojs/register)
  34. * Contact (modal_forms/nojs/contact)
  35. * Comment (modal_forms/nojs/comment/reply/%node)
  36. * Webform (modal_forms/nojs/webform/%node)
  37. Function that rewrite normal links to modal forms links (except for webforms)
  38. can be activated on the modules configuration page.
  39. LINKS TO THE MODAL VERSION OF THE FORMS
  40. ---------------------------------------
  41. JavaScript that can rewrite standard links to these forms in to a modal
  42. equivalent are provided, see the module configuration page to activate them.
  43. To build links in code I recommend using the ctools_modal_text_button() function
  44. $links[] = ctools_modal_text_button(t('Modal Login'), 'modal_forms/nojs/login', t('Login via modal'));
  45. $links[] = ctools_modal_text_button(t('Modal Login'), 'modal_forms/nojs/login', t('Login via modal'), 'ctools-modal-modal-popup-small');
  46. It is also possible to build links manually.
  47. Modal Login
  48. Modal Login
  49. Popup styles and sizes:
  50. The include CSS file tries to mimic the default Colorbox style.
  51. The extra class "ctools-modal-modal-popup-small" in the links above tells the
  52. project what popup style size to use. There are three options included.
  53. * ctools-modal-modal-popup-small (defaults to 300x300)
  54. * ctools-modal-modal-popup-medium (defaults to 550x450)
  55. * ctools-modal-modal-popup-large (defaults to 80%x80%)
  56. Go to the configurations page for Modal forms to adjust the sizes.
  57. WEBFORMS
  58. --------
  59. There is support to open webforms in a modal by constructing special links.
  60. A webform link should look like this one:
  61. Link to click
  62. Replace [nid] with the node id of your webform.
  63. MAINTAINERS
  64. -----------
  65. Current maintainers:
  66. * Fredrik Jonsson (frjo) (http://drupal.org/user/5546)
  67. * Renato Gonçalves (RenatoG) - https://www.drupal.org/user/3326031