I have scoured the issues and readme.txt file for a way to implement popups to allow a node edit form in a popup. I my be just missing something simple but I cant for the life of me figure out how to get a link to show up in a popup. in the documentation it says

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.

bottomline-I am just lost and need serious help before I lose it. if someone could give me a step by step tutorial of how to get a link on the user profile page (created in the user-profile.tpl.php) to use the popup api I would be super super grateful.

Comments

sirkitree’s picture

check the 'scan for all popup links' on /admin/settings/popups. then simply give your link a class of 'popups'.

lelizondo’s picture

subscribing. I still don't get how to give the link a class of popups.. creating a module with:

function my_popups() {
    return array(
      'node/add' => array (
        'a[href~=node/add]',
      ),
    );
  }

won't do anything

I'm pretty sure I'm missing something obvious because Popups Administration Links isn't working, not even with garland.

The only thing that works are the messages.

lelizondo’s picture

Ok, I've got something. I'm sure it's not the right way to go but it's working and I'll appreciate anyone who could explain a better way to do this:

in admin/build/themes/settings/community the Content Selector is: div#page > div#center. That's only because of the theme.
in admin/settings/popups I have selected "Scan all pages for popup links."
I'm overriding theme_node_form with something like this:

function mythemename_node_form($form) {
  $output = "\n<div id=\"popit\">\n";
  $output .= "\n<div class=\"node-form\">\n";

  // Admin form fields and submit buttons must be rendered first, because
  // they need to go to the bottom of the form, and so should not be part of
  // the catch-all call to drupal_render().
  $admin = '';
  if (isset($form['author'])) {
    $admin .= "    <div class=\"authored\">\n";
    $admin .= drupal_render($form['author']);
    $admin .= "    </div>\n";
  }
  if (isset($form['options'])) {
    $admin .= "    <div class=\"options\">\n";
    $admin .= drupal_render($form['options']);
    $admin .= "    </div>\n";
  }
  $buttons = drupal_render($form['buttons']);

  // Everything else gets rendered here, and is displayed before the admin form
  // field and the submit buttons.
  $output .= "  <div class=\"standard\">\n";
  $output .= drupal_render($form);
  $output .= "  </div>\n";

  if (!empty($admin)) {
    $output .= "  <div class=\"admin\">\n";
    $output .= $admin;
    $output .= "  </div>\n";
  }
  $output .= $buttons;
  $output .= "</div>\n";
  $output .= "</div>\n";

  return $output;
}

notice

  $output = "\n<div id=\"popit\">\n";

Clear the cache and try to add any node. You'll get a popup with the node form, but not the form title.

Any help with this to do it some other way?

nwe_44’s picture

I'm trying to do something similar, along with adding the edit links generated by views to the list of popup links.

At the moment I"m trying to use hook_link_alter() to add classes like "popups-form" to the links I want, along with turning on the popups api option "scan all pages"

I'm pretty new to using hooks at all so any help would be much appreciated.

Parkes Design’s picture

I've got the links on the profile page to bring up the popup form, validation and everything works but when submitting the form to return to the user profile page the page loads within the popup?

Has anyone had this problem before?