I would like to have this form:

The page, there is a link,link to the node/add/**.

I can click on the link, the page of node/add/** is pop-up and I can edit.
How should I do?

Comments

rc2020’s picture

You read the README.TXT file and realize that it's all explained for you right there!

; )

As follows....

  HOW TO USE THE POPUPS API
  ------------------------------------------------------------------------------------  
  If you just want to use the built in admin links, just enable the Popups: Admin Links
  module and you are good to go.
  If you want to add popups behavior to new links, or incorporate popups into your module,
  there are a couple of ways to do it.
  
  #1) Attach popup behavior to a link with popups_add_popups() call.
  ----------------------------------------------------------------  
  <!-- In html or theme -->
  <a href="popups/test/response" id="mylink"> 
  <a href="popups/test/response" id="mylink2"> 
  
  // In your module
  popups_add_popups(array('#mylink', '#mylink2=>array('width'=>'200px')));  
  IMPORTANT: You can only put popups_add_popups in module, NOT in a .tpl file 
             or the template.php file.
  This is the simplest method if you want to pass in per-link options.
  The first key is a jQuery selector. It should select an 'a' element (unless you 
  are using the 'href' option). See http://docs.jquery.com/Selectors to learn more 
  about jQuery selectors.
  The array is a set of Options. See below for the list of options.
  No array means just use the defualts. 
  
  #2) Add the class="popup" to an existing link.
  -------------------------------------------
  And then either be sure popups_add_popups() is called sometime for the page,
  or use the "Scan all pages for popup links" checkbox on the popups settings page. 
  
  Example on the theme level ("Scan all pages for popups links" must be checked):
    <a href="popups/test/response" class="popups">

  Example in code:
    popups_add_popups();
    $output .= l("Pop up entire local page.", 'popups/test/response', array('attributes'=>array('class' => 'popups')));
  
  Here are the classes that you can use:
  class="popups" requests an informational popup (or a form that doesn't want ajax processing).
  class="popups-form" requests a popup with a form that modifies the content of the original page.
  class="popups-form-reload" requests a popup with a form, and reloads the entire page when done.
  class="popups-form-noupdate" requests a popup with a form, and leaves the original page as-is.
  
  You can use the pseudo-attribute, "on-popups-options" to send options, if you don't mind having non-validating HTML.
  Note: this attribute gets removed from user content by the HTML filter.
  Example:
    print l("Pop with options (width=200px).", 'popups/test/response', 
             array('attributes'=>array(array('class' => 'popups', 'on-popups-options' => '{width: "200px"}'))))
  See popups_test.module for more examples.    
  
  #3) Add a custom module that implements hook_popups().
  ---------------------------------------------------------------------
  hook_popups() returns an array of popup rules, keyed by the id of a form, 
  or the url of a page (which can use the wildcard '*').
  Each rule is an array of options, keyed by a jQuery selector.  
  Leaving off the options array is equal to a link with class="popup-form".
  This is equivent to using a series of popup_add_popups() calls.
  
   Rule Format Example:
   'admin/content/taxonomy' => array( // Act only on the links on this page. 
     'div#tabs-wrapper a:eq(1)',  // No options, so use defaults.
     'table td:nth-child(2) a' => array( 
       'noUpdate' => true, // Popup will not modify original page.
     ),
   );

  LIST OF POPUP OPITIONS
  ------------------------------------------------------------------------------------  
   noUpdate: Does the popup NOT modify the original page (Default: FALSE).
   href: Override the href in the a element, or attach an href to a non-link element.
   width: Override the width specified in the css.
   targetSelectors: Hash of jQuery selectors that define the content to be swapped out.
   titleSelectors: Array of jQuery selectors to place the new page title.
   reloadWhenDone: Force the entire page to reload after the popup form is submitted (Default: FALSE)
   reloadOnError: Force the entire page to reload if the popup href is unaccessable (Default: FALSE)
   noMessage: Don't show drupal_set_message messages.
   nonModel: Not working.
   forceReturn: url to force a stop to work flow (Advanced. Use in conjunction with noUpdate or targetSelectors).
   [These last two can only be called from the hook, not the attribute]
   additionalJavascript: Array of JavaScript files that must be included to correctly run the page in the popup. 
   additionalCss: Array of CSS files that must be included to correctly style the page in the popup. 
chien_fu’s picture

I've created a popup by scanning all pages for popups and using the class="popups-form-reload" and directed the popup to a /node/add/foobar page.

<a href="/node/add/foobar/<?php print $node->nid; ?>" class="popups-form-reload">Add Foobar</a>

I'm printing the NID because I'm also using Nodereference URL to create a foobar node that references the current node.

I have other popups that are working, but when I click this link it brings up the loading graphic, but then just hangs forever. When I click the background to get rid of the loading graphic, my cursor still remains an hourglass even though it's clear nothing is going on.

Any advice?

v8powerage’s picture

Issue summary: View changes

I used to know how to do it but I've forgotten maybe someone remind me? I have custom module and I want to open various links on page with it but not by their id's rather by their addresses like this

function popups_custom_popups() {
    return array(
popups_add_popups(array('/logout', '/logout=>array('noUpdate' => TRUE, 'reloadOnError' => TRUE'))));  

}

I used to have something like this, it was logging out users and stayed on same page which was pretty cool but this code isn't working..