Page 1 of 1

Youtube video

Posted: 2020-02-16 12:47
by Moh Youba
Hello
I am looking for the best practice to add Youtube video on the login page, any help please.

I get the code from Youtube but do not know where and how to add

the code from youtube
<iframe width="560" height="315" src="https://www.youtube.com/embed/ItF8aCJe6jw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
youtube.jpg
youtube.jpg (152.68 KiB) Viewed 4446 times
Thank you

Re: Youtube video

Posted: 2020-02-16 19:59
by pbottcher
Hi,

you can try to edit the hooks/header-extras.php and add

Code: Select all

<?php
	$mi = getMemberInfo(); $url=basename($_SERVER['PHP_SELF'],".php");	
	if ($mi['group'] == 'anonymous' && $url == "index") {
		?>
		<script>
			$j(function(){
				$j('#login_splash').append('<iframe width="560" height="315" src="https://www.youtube.com/embed/ItF8aCJe6jw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');
			})
		</script>
		<?php
	}
?>

Re: Youtube video

Posted: 2020-02-17 10:50
by Moh Youba
Hi

Thank you for your support.

regards,