Dirk67
I am a little lost here ... 😉
(something works on J3 but not on J4)
---------
I created an article with modals and sourcerer that acts as a redirection to youtube videos but the user has to press a button for giving his consent ...
in detail:
if there is a youtube link within any article it links to article ID
2023 with the yt-video-ID as an URL parameter
e.g.:
in J3:
hilgermissen.eu/joomla/2023?yt_id=f5gq5LzCqho
in J4:
hilgermissen.eu/joomlaclone/unzugeordnet/2023?yt_id=f5gq5LzCqho
then within article ID
2023 the the yt-video-ID is handled with some sourcerer code and then a modals popup is generated with:
{modal url="unzugeordnet/[b]2022[/b]?'.$param.'" width="500" height="500" open="true"}{/modal}
(variable "$param" contains the yt-video-ID)
as you can see: inside the modals popup the article ID
2022 is displayed
and within article ID
2022 (= inside the modals popup) I use the following code for the 2 buttons (with sourcerer):
{source}<button onclick="window.open('', '_self', ''); window.close();" style="padding-left: 10px; padding-right: 10px; margin-left: 50px;" class="btn btn-default">Abbrechen</button>{/source}
resulting in a html output like:
<div>
<a class="btn btn-primary" style="padding-left: 10px; padding-right: 10px;" href="https://youtu.be/f5gq5LzCqho">weiter zu YouTube</a>
<button onclick="window.open('/joomla/', '_self', ''); window.close();" style="padding-left: 10px; padding-right: 10px; margin-left: 50px;" class="btn btn-default">Abbrechen</button>
</div>
the wanted browser behavior is, to stay in the
same browser window or tab when the user presses the green consent button.
This works fine on J3:
hilgermissen.eu/joomla/2023?yt_id=f5gq5LzCqho
but fails on J4:
hilgermissen.eu/joomlaclone/unzugeordnet/2023?yt_id=f5gq5LzCqho
as you can see on J4 the browser tries to open the youtube video within the modals popup, and that fails ...
(same wrong behavior for the window.close() "Abbrechen" -button)
So why is that different browser behavior between J3 and J4,
and how I can overcome that ?
how can I achieve the "wanted browser behavior" that is, to stay in the
same browser window or tab when the user presses the green consent button ?
__________________________________________________
modals versions:
on J3: v12.3.5 pro
on J4: v12.3.6-dev2676083 pro
sourcerer versions:
on J3: 9.5.2
on J4: 9.5.2
Confidential information:
(hidden)