1

I added a edit link using hook_form_alter in my node form..When I clicked on this link it goes edit content page. But I need to open this form on popup and change the form value from here.

My question: How to open a node form in popup after click on edit from front end?

1

If you want to go through custom module you need to follow instructions given here. If you are looking for contrib module colorbox or modal forms to edit your content on modal popup(using Ctool).

| improve this answer | |
  • I need this functionality within hook_form_alter.. because I added a link using form alter – jsh Oct 8 '15 at 9:22
  • function customjsh_form_alter(&$form, &$form_state, $form_id){ $node = menu_get_object(); if ($node = menu_get_object()) { if($form_id == "uc_product_add_to_cart_form_".$node->nid && $node->type == 'product'){ $paths ="node/".$node->nid."/edit/options"; print l('link', $paths); } } } – jsh Oct 8 '15 at 9:25
0

Try

  1. Popup Module.

The popup suite allows builders to popup tooltip-like text, nodes, blocks, menus, forms, views and php-generated content.

  1. Popup forms Module.

This module provides an easy way for developers to display any Drupal form in a popup (through jQuery UI dialog). Note: this module does nothing itself and only provides API for module or theme developers. There are plenty of modules that display something in popups, the most popular of them is Popup (for Drupal 7). The main difference from this kind of modules is that Popup forms does one thing (and does it well): it opens form in a popup.

May be this will help you..

| improve this answer | |
0

Creating CTools popups (modal windows) is not a complicated thing, but it has many important nuances. Therefore, this article is devoted to the various nuances of popup creation.

The simplest CTools popup

To create the simplest Ctools popup, you just need to write one line of JS code Drupal.CTools.Modal.show();. This JS function will create a full-fledged Ctools popup, you will just have to add content. As an example, let us create a popup that will appear when the page loads.

;(function($) {
Drupal.behaviors.firstPopup = {
attach: function (context, settings) {
var content = 'my content';
     var title = 'my title';
     Drupal.CTools.Modal.show();
     $('#modal-title').html(title); // Adding title to popup;
     $('#modal-content').html(content); // Adding content to popup;
   }

}
})(jQuery);

Add this JS to the desired page — and your first, simplest popup is ready. However, it has one drawback — like any other JS, it can output only data generated on the client’s side. Of course, in many cases, this may be enough, but more often Ctools popups are used to output dynamic data from the server. So let us consider more complex, but more common cases of popup creation and usage.

For more details about POPUP

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.