- Issue created by @philalawst
- 🇧🇷Brazil renatog Campinas
Interesting
You can have 1 modal on CMS that appears for 2 domains?
Like:
- mydomain_modal1
- mydomain_modal2
- mydomain_modal3
And others
- mydifferentdomain_modal1
- mydifferentdomain_modal2
- mydifferentdomain_modal3
And you have 2 sites using the same CMS?
Like
Is that?
How it works? Like multisites or using platform that has one module for 2 sites?
Asking just as a curiosity. Maybe we can think about a feature to allow this natively instead of hook, you know?
- 🇧🇷Brazil renatog Campinas
In the function ModalPageService::loadModalsToShow(), is it possible to make a change ?
Change:$modalsToShow[] = $modalToShow;
byif($modalToShow)
$modalsToShow[] = $modalToShow;Yes, it's possible
I'd suggest making this change in your local
If it works feel free to post a patch or Merge Request
We can test for other scenarios
If it works we can merge that into 5.x and 6.x - 🇧🇪Belgium philalawst
@renatog thanks for your answer.
Yes I'm using the module "Domain" (one drupal for many sites)
and with the suggest change, i could use this moduleOr maybe to handle domain in the field "Page"
https://mydomain.com/
https://mydomain.com/event
https://mydomain.com/event/*in verifyModalShouldAppearOnThisPath.
public function verifyModalShouldAppearOnThisPath($path, $currentPath) { $host = \Drupal::request()->getSchemeAndHttpHost(); $path = preg_quote($path, '/'); $path = str_replace('\*', '.*', $path); return preg_match('/^' . preg_quote($path, '/') . '$/i', $currentPath) || preg_match('/^' . preg_quote($path, '/') . '$/i', $host.$currentPath); }