Questions tagged [modal-dialogs]

Use it for questions about modal popup dialogs, including the overlay implemented in the Drupal 7 Overlay module.

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

Display constraint error in the ajax modal window

From within a form, I have added a link which open a modal form in which I can edit a Paragraph. Here is the code for this link: $form['my_modal_edit_form'] = [ 'title' => $this->t('Edit'), '...
0
votes
0answers
15 views

Dialog form submit button fails to trigger submitForm()

I load this form into a dialog using: $content = \Drupal::formBuilder()->getForm('Drupal\web_core\Form\MyForm'); $response = new AjaxResponse(); $response->addCommand(new OpenDialogCommand($...
1
vote
1answer
37 views

Display status message after submitting modal popup form

Ok so i have a custom entity and want to display a custom delete form. Have created the Route and everything works except for Drupal messenger displaying status message after submission, even after a ...
1
vote
0answers
10 views

Dynamically added params for a link not found when the link is opened with a dialog

I do not know if it has to do with JavaScript/Ajax or with Drupal's dialog modal. Any advice is appreciated. On our project we open several links in a modal. For this the link is rendered in the ...
0
votes
0answers
61 views

Passing data-dialog-options and data-dialog-type dynamically to an <a> tag not opening modal

I'm trying to create a dynamic way to open a modal window in drupal. The current structure work like this. <a class="use-ajax" href="/node/810">Testing 1 </a> For that ...
0
votes
1answer
37 views

How do I display a modal dialog on page load, with working title and dialog options, using OpenModalDialogCommand?

I'm trying to display a modal dialog containing some simple markup on page load. I'm getting the expected markup to load, and the dialog appears. However, the dialog title always displays "...
0
votes
0answers
33 views

OpenModalDialogCommand without site configuration permission

I have a custom module in Drupal 8.9.9 to open a form in a modal dialog with OpenModalDialogCommand. The custom_modal.routing.yml file has: custom_modal.open_modal_form: path: '/modal_form/{title}/{...
0
votes
1answer
53 views

AJAX Modal Form

I created a modal form with Ajax: <?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the ...
1
vote
1answer
112 views

Custom form calls different form in modal, submit/ajax callback of second form not called

I created 2 forms: dms_gift_voucher/src/Form/GiftVoucherForm.php ... /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { .... $...
1
vote
1answer
337 views

Show node links in modal buttonpane

I want to show some node fields in buttonpane when I open node in modal. As far as I know, it will automatically show there inputs with type submit and links with class button, but I added class ...
1
vote
1answer
155 views

Add event listener to modal close

In Drupal we can open a modal is two ways, either with HTML: <a class="use-ajax profile-page-link" data-dialog-type="modal" href="/node/1" data-dialog-options="{&...
2
votes
1answer
156 views

Open ajax dialog with JavaScript

By adding use-ajax to a link we can open a modal using the Drupal ajax library as per the docs. E.g. <a class="use-ajax" data-dialog-options="{&quot;width&quot;:400}&...
2
votes
2answers
163 views

Using attach_library in a modal

For ref, I'm working on https://www.drupal.org/project/focal_point/issues/3162218 I have a twig file that handles the contents of a modal window and I want to load a particular CSS file whenever this ...
1
vote
1answer
33 views

Form in modal dialog: Template suggestions have weird random suffix

My custom module has the following form route in mymodule.routing.yml: library_assets.add_asset_to_slideshow_modal: path: 'library/add-to-slideshow-modal/{library_asset_nid}' defaults: _form: ...
0
votes
0answers
39 views

Replace the default modal with a different one

I want to replace Drupal 8 default modal with MDB. How I can do it? Should I unload default library for modals and load new one? Any idea?
0
votes
1answer
40 views

Popups & colorbox issues in Chrome

Hoping for some guidance here. Sometime in the past few weeks, my inline modal popups stopped working in Chrome. I had Colorbox set up at the time, both hand coded inline links and views colorbox ...
1
vote
1answer
59 views

How do form #states interact with dialog action buttons, if at all?

A dialog can be fired by a link formatted as such: <a class="use-ajax" data-dialog-options="{&quot;width&quot;:400}" data-dialog-type="modal" href="/some/path"> Some ...
0
votes
0answers
503 views

Programmatically get the current url of the page from where a Webform in a dialog has been loaded

The below link will open the webform (contact) in a dialog: <a href="/form/contact" class="btn btn-success webform-dialog webform-dialog-normal">Contact</a> this same link has been ...
3
votes
1answer
935 views

How do I theme the core modal with twig?

Drupal 8 comes with built in modals. This works: <a href="/node/11" class="use-ajax" data-dialog-type ="modal">modal</a> How can I style that modal using twig, to add new classes to the ...
1
vote
1answer
56 views

How to have a dialog box displayed automatically when a page is reached without having to click the link?

Using Dialog API and advice from @leymannx, I added this link to a node (node99): <a class="use-ajax" data-dialog-options="{&quot;width&quot;:600}" data-dialog-type="modal" href="/node/...
1
vote
1answer
168 views

How to populate an Entity Reference field from a modal AjaxResponse?

I have an entity ref autocomplete field (reference to bundle A) in one of my bundles (bundle B). I want to add a button below this field which will open a modal for a bundle A create form. This code ...
0
votes
1answer
132 views

Creating ajax modal from event

Here's the deal. I want to create a modal popup when an add to cart event is triggered. I've got the event working just fine but can't seem to get the ajax to work properly. What I'm working off of ...
1
vote
1answer
235 views

How to get node title using this query on template?

Im building a custom filter in Drupal 8 based on some queries. I got this already, here im filtering by values on body: $query = db_select('node__body', 'n') ->fields('...
1
vote
1answer
31 views

Issue regading custom form

https://wineshipinsure.com/newdrupal/ex81/helloform I have been using the custom form and followed all the process for creating the custom form but my form is not working and every time getting page ...
0
votes
1answer
120 views

How to open a link in ctools modal by clicking a views row in table format?

I want to open a page in ctools modal. This works for me. <a href="/my-page/nojs" class="ctools-use-modal">Click</a> But now I want to open the same page in ctools modal by clicking the ...
0
votes
1answer
300 views

How do I set the Layout builder modal to use the administrative theme?

I'm building a custom Drupal theme and wondering if there is a way to get the modal windows to use the default admin theme. I'm using the Layout builder module with a custom block that uses the Media ...
0
votes
0answers
40 views

SweetAlert doesn't display content markup

The SweetAlert modal is not displaying the content as passed in the option array when returning a response from the controller. Please see the code config below: //$options = ...
1
vote
0answers
29 views

8 - How can I update the entity reference fields of the form when I close the modal?

How can I update the entity reference fields of the form based on selection in the modal dialog when I close the modal ? I have a form and users starts fill the form. Then click on choose address ...
-1
votes
1answer
49 views

on click popup load another popup and close other popup

I'm having a requirement where I have to show popup on the click link. and then after that pop up open need to show related content on that pop-up. this part is working. by doing this <a class="...
0
votes
1answer
148 views

How to get my button in a dialog click?

I have added the following JS to a node form, it clones the submit button but clicking it inside the dialog (which does show up) doesn't submit the form in the browser, just nothing happens when the ...
0
votes
1answer
131 views

Show rendered node in jQuery modal through JSON

Whenever a link has a specific class I want to show it as a jQuery modal. I have added the neccesarry data attributes to the link in order to be able to use it as a modal. I have also created a route ...
0
votes
1answer
63 views

Create a modal popup

I want to show a modal popup in drupal 7. On searching the web I came to know that it can be done using the ctools module itself. Here is the code I tried: function codeexpertz_menu() { $items['...
1
vote
1answer
384 views

How do I use Bootstrap theme's modal.jquery.ui.bridge's mapped events?

I am using a Bootstrap subtheme, and would like to trigger an event when a modal is closed. Reviewing the main theme's modal.jquery.ui.bridge.js file, I see that the bridge is intending to map jQuery ...
0
votes
1answer
34 views

Modal dialog doesn't work

I want to display ctools modal. I tried the following code. /** * Implements hook_menu(). */ function my_module_menu() { $items['my_module/%ctools_js/test-page'] = array( 'title' => 'Demo ...
1
vote
1answer
62 views

Modal does not handle errors on login

I have used 'use-ajax' class to render login form in a modal. I want to handle validation errors on same modal without closing it. On successful login it is redirecting correctly, but when an error ...
0
votes
1answer
927 views

How to open a node edit form in an overlay (modal window) in Drupal 8

I have a view with nodes of type 'tasks'. I want to easily view and edit these tasks by using a minimized overlay. When I click on a task title in the view, it needs to open in an overlay. In D7 this ...
0
votes
1answer
550 views

How do I trigger a modal from a template that points to a controller returning an AJAX response

I am trying to trigger a modal from a twig. The path of the modal is a controller that returns an AJAX response as below: Routing code usgbc_myaccount.get_badges_evidence_controller: path: '/account/...
1
vote
1answer
1k views

How do you create a link to a modal dialog?

The following code does not work: <div class="topics"><a class="use-ajax" data-dialog-type="modal" href="/topics-listing">All Topics</a></div> Drupal 8.6.5. Bootstrap ...
1
vote
1answer
1k views

How to display a form in modal dialog on page load?

This is on Drupal 8.6, PHP 7.2, Theme is based on Bootstrap. The scenario is, I want to display a dialog box with a subscription form in the home page. The dialog box will be loaded automatically ...
0
votes
1answer
309 views

Modal Form Submission

I have a modal form that I added to my module and patterned it after this article. I have used it before with no issues, I was able to use the method to show the form and then save the data. Now ...
6
votes
0answers
1k views

How do I theme a modal popup?

How can I style Drupal 8 modal window to achieve Instagram style and behaviour? I'm creating modal through extending ControllerBase class, thus have full control of content. However I can't figure it ...
1
vote
0answers
58 views

Open Paragraphs-item into an entityform

I have a profile page with many paragraph sections. I am trying to open the input form for every paragraph separately into a modal form. I don't want to manually build a form for each paragraph. The ...
2
votes
0answers
300 views

Why does my chart created with Easychart not display a chart if number of points are more than 1000?

I installed Easychart module 7.x-3.7 in my Drupal 7.51 site. I'm using Highcharts 4.2.7 in libraries 7.x-2.3. In the example contenttype easychart_ex, I tried uploading a data.csv file with number ...
0
votes
0answers
427 views

How to open video from a video link in an overlay on the same page?

How to open a video from a video link in an overlay on the same page? For example, If you go to google news you would have seen the video attached on the link, open as an OVERLAY, and play on the same ...
0
votes
1answer
298 views

Administration page doesn't show pop-up (overlay) windows

When I try to place new block by clicking "Place block" button or when I click "Configure" on the block I see no pop-up window as I see in tutorial videos, like here: https://www.youtube.com/watch?v=...
0
votes
1answer
6k views

How to display a Leaflet map in modal window?

I produce geospatial data in a content type with addressfield and geofield. I can display this data in a Leaflet map as field without any problem. But I have to use here a modal, therefore I render ...
1
vote
0answers
16 views

Get the path to current page which has an overlay [duplicate]

I have a page on which there is an overlay. I'm able to get the overlay's path using current_path(). How can I get the page's path on which the overlay is loaded. Any ideas ? Thanks
1
vote
0answers
29 views

Node Update - Overlay

I have a problem on saving a specific node. When I try to save it the overlay doesn't disappear, but the node is correctly saved and updated. If I change node title everything works good. I attach an ...
0
votes
1answer
231 views

Right side overlay panel Solution

quickie, I want to create a right-hand side sliding overlay panel for my drupal site. I have been googling and testing solutions for hours. The exact effect that I want can be found here. The ...
3
votes
1answer
135 views

Is there any way to cancel Panels' overlay edit windows?

I don't want to edit Panel panes via overlay edit-windows and therefore I tried to disable the core "Overlay" module at admin/modules but it seems to effect everything except the overlay of the Panels ...