6

How do I display delete confirmation form in a modal window? I have a view which displays submissions of an entity form. Each one has a 'delete' link for the admin to remove a particular submission, but clicking it goes to a new delete confirmation page (entityform/[nid]/delete). How can I display this confirmation page in a modal overlay, like the edit forms?

I tried the overlay_path module but it tried to display a styled page in the overlay and it looked terrible with my current theme

1

2 Answers 2

2

You can use https://drupal.org/project/ctools_automodal and then use menu_alter to use following code and see if it helps.

function modulename_menu_alter(&$items) {
    $items['entityform/%entityform/delete']['modal'] = TRUE;
}

Be sure to clear cache.

1
  • That did open the page in a modal, but it tried to use the page styles in it and it looked messed up. Also it looks like it used its own modal style rather than the usual Drupal overlay. Thanks anyway though.
    – nexus_6
    Commented Mar 26, 2014 at 13:18
0

Module Modal operaitons do this. https://www.drupal.org/project/modal It is no readme, but here is example. This link was open node view in modal window.

//As Example:
<a href="/modal/node/NID/nojs" class="ctools-use-modal">View</a>

Or this my code for delete node (for Views PHP)

<a href="<?php global $base_url; echo $base_url; ?>/modal/node/<?php echo $row->nid; ?>/delete/nojs" class="ctools-use-modal">Delete</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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