- Issue created by @eahonet
- Status changed to Needs review
12 months ago 1:24pm 12 December 2023 - π·πΈSerbia levmyshkin Novi Sad, Serbia
Hi eahonet, for your case it will be easier to use 'use-ajax' class:
https://www.drupal.org/docs/develop/drupal-apis/ajax-api/ajax-dialog-boxes βBut you will be needed to include libraries in dependencies:
dependencies: - core/jquery #Just to be safe - core/drupal.dialog.ajax #Required for dialogs - core/jquery.form #If you also want to use Ajax for form operations
As it's described in the article above.
It's also possible to do with GLightbox. You need to enable GLightbox Inline module, then it will be possible to call pages and return content from specified ID. If you pass id for block after base URL, then only this block will be loaded in popup. Also you need to add 'glightbox-inline' for this kind of links:
It works using jQuery .load() under the hood or similar way:
https://api.jquery.com/load/ - πΊπΈUnited States eahonet
This was very helpful @levmyshkin
But note: if the ID exists on the current page, it will pull that rather than the ID'd section from the linked page. That's what made me think it didn't work. Once I added a different ID to the other page it worked as expected.
- Status changed to Fixed
11 months ago 8:19pm 14 December 2023