Background image on all page AppGini 5.81

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

Background image on all page AppGini 5.81

Post by Moh Youba » 2019-10-31 20:35

Hello

Is is a way to add background image on all page?

Thank you.

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Background image on all page AppGini 5.81

Post by onoehring » 2019-11-08 16:26

Hi,

define some CSS that does that:
Like this:

Code: Select all

<style>
	body {
	background: url("yourimage.jpg") no-repeat fixed center center / cover;
	}
</style>
(works also from your hooks/footer-extras.php file)

Olaf

Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

Re: Background image on all page AppGini 5.81

Post by Moh Youba » 2019-11-08 19:19

Hi Olaf

Thank you for sharing.

Best regards

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Background image on all page AppGini 5.81

Post by dannybridi » 2020-02-20 08:32

Hi Olaf,

I added the following to footer-extras.php file:

Code: Select all

<?php
$script_name = basename($_SERVER['PHP_SELF']);
if($script_name == 'index.php' && isset($_GET['signIn'])){
	?>
	<style>
		body{
			background: url("hooks/logo.jpg") no-repeat fixed center center;
			background-size: 60%
		}
	</style>
	<?php
}
?>
As a result, I see the background image only on the login page. What should I do to see the image on all pages?

Thanks

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Background image on all page AppGini 5.81

Post by onoehring » 2020-02-20 09:58

Hi,

just add only the CSS - not "full" php script:

Code: Select all

<style>
		body{
			background: url("hooks/logo.jpg") no-repeat fixed center center;
			background-size: 60%
		}
	</style>
this should probably work.
Olaf

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Background image on all page AppGini 5.81

Post by dannybridi » 2020-02-20 10:17

Yes, that works!

Thanks!!

Post Reply