Totara Learn Open Discussions

Add background image

 
Its me Rahul
Add background image
von Rahul Kumar – Friday, 14 September 2018, 3:05 AM
 

Hi All,

could you help me with little thing,

I would like to add a background image on my totara site, please could you tell me how can I do that , I am doing this Site Admin > Appearance > Theme > Basis > adding in custom css

#page-content {background: url(http://C:/Apache24/totara/theme/basis/pix/doctor.jpg) repeat;}

I am using totara version 11.2 and basis theme.

I am looking forward to hearing from you.

Regards

Rahul


Marek Hanacek
Re: Add background image
von Marek Hanacek – Monday, 17 September 2018, 2:42 PM
Gruppe Partners
Hi,

just use full url like
#page-content {background: transparent url('http://your.totara.url/theme/basis/pix/doctor.jpg') repeat center center scroll;}
your.totara.url == $CFG->wwwroot (from config.php)

Enjoy :)
Its me Rahul
Re: Add background image
von Rahul Kumar – Tuesday, 18 September 2018, 3:17 AM
 

Hi Marek,

Thank you so much for your reply.

I am doing the same as you have mention but on my local server its not showing any image on background and just display the heading on page and If I click on any on the heading it shows "coding erroe detected"

#page-content {background: transparent url('http://localhost/index.php?redirect=0/theme/basis/pix/med.jpg')repeat center center scroll ;}

I am attaching the snap shot my error , please tell me where I am doing wrong.

I am looking forward to hearing from you.

Please find the attachment 



Its me Rahul
Re: Add background image
von Rahul Kumar – Wednesday, 19 September 2018, 6:04 AM
 

Hi Marek

In custom css block in SA>Appearance>Theme>basis>custom css 

#page-content {background:transparent url('http://index.php?redirect=0/theme/basis/pix/med.jpg')repeat center center scroll ;}


In config file totara/config.php

$CFG->wwwroot = 'http://index.php?redirect=0';


Thanking you


Regards

Rahul





Marek Hanacek
Re: Add background image
von Marek Hanacek – Tuesday, 25 September 2018, 3:20 PM
Gruppe Partners
Hi Rahul,

First of all, you have to had functional Totara instance. It looks like you have problems with Basis theme at all, maybe not properly installed Totara.
So let's change totara/config.php to
$CFG->wwwroot = 'http://localhost';
and try to reload homepage (refresh browser page). If it still looks like your screenshot (white page with blue links) try set
$CFG->wwwroot = 'http://localhost/totara';
it this helps :)

If first url works, use
#page-content {background:transparent url('http://localhost/theme/basis/pix/med.jpg')repeat center center scroll ;}
otherwise
#page-content {background:transparent url('http://localhost/totara/theme/basis/pix/med.jpg')repeat center center scroll ;}
Its me Rahul
Re: Add background image
von Rahul Kumar – Wednesday, 26 September 2018, 1:08 AM
 

Hi Marek, 

Thank you so much for your reply and help :)

I have manage to set it up background image on home page and log in page on totara site but if I am trying to add a image on different page on my site its not working 


body{background-image: url(http://localhost/theme/basis/pix/med.jpg);no-repeat center center fixed;-webkit-background-size: cover;

-moz-background-size: cover;

-o-background-size: cover;

 background-size: cover;}- this image is showing on every page 

#page-login-index { background-image: url(http://localhost/theme/basis/pix/doctor.jpg);

no-repeat center center fixed;-webkit-background-size: cover;

-moz-background-size: cover;

-o-background-size: cover;

 background-size: cover;}

but to set the the image on danshboard page its not working 

/*#page-content{background:transparent url(http://localhost/totara/dashboard/index.php/theme/basis/pix/health.jpg);repeat center center scroll ;}*/

/*#page-content{background-image url(http://localhost/totara/dashboard/index.php/theme/basis/pix/health.jpg) ;}*/

/*#page-content{background-image url(http://totara/dashboard/index.php/theme/basis/pix/health.jpg);repeat center center scroll ;}*/

and my config php file is the same 

$CFG->wwwroot   = 'http://localhost';

$CFG->wwwroot = 'http://localhost/totara';---> this is not working in config.php file


Please find the attachment 

once again thank you so much for your help.

I am looking forward to hearing from you.

Regards

Rahul





Marek Hanacek
Re: Add background image
von Marek Hanacek – Wednesday, 26 September 2018, 4:04 PM
Gruppe Partners

Just use only:

body {
background:transparent url('http://localhost/theme/basis/pix/med.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}


I will kindly advice you to educate more about html+css syntax&value declaration and then try some stuff over Totara :)
Or hire (SOW) somebody/partner when you need specific theme etc

Its me Rahul
Re: Add background image
von Rahul Kumar – Wednesday, 26 September 2018, 11:48 PM
 
Dear Marek, 


Thanks for your reply.

I guess  you have miss understood my question. I am able to set it up image background image, what I was asking how to set up different image on different back ground. 

Regards

Rahul

Marek Hanacek
Re: Add background image
von Marek Hanacek – Thursday, 27 September 2018, 1:51 AM
Gruppe Partners

ok, than you have to focus on <body> classes and ID

You can have like default image across all totara :
body { background: ... default.jpg .... }

and add this lines to spefigy image just for dashboard pages
body.pagelayout-dashboard { background: ... dashboard.jpg .... }

or for frontapage/homepage special image add
body.pagelayout-frontpage { background: ... frontpage.jpg .... }

for login page
body.pagelayout-login{ background: ... login.jpg .... }


Is it clear now?

Its me Rahul
Re: Add background image
von Rahul Kumar – Thursday, 27 September 2018, 7:24 AM
 

Hi Marek, 

Billions thanks to you mate.

now I can set different image on each page.

I was looking for this from a long time and you have help me out a lot.

Still figuring out how to set background on on record of learning in the menu bar page.

Thank you so much :)

Regards

Rahul





Marek Hanacek
Re: Add background image
von Marek Hanacek – Thursday, 27 September 2018, 9:37 AM
Gruppe Partners

If I understand correctly, you want to have different background on record of learning page? Like you have another bg for login / homepage / dashboard page?

Than just try to use:
body.pagelayout-report { background: ... report.jpg .... }


Its me Rahul
Re: Add background image
von Rahul Kumar – Friday, 28 September 2018, 12:36 AM
 

Hi Marek, 


That's great mate.

I would like to know to that do you provide personal learning on theme creation and theme customization for totara and how to identify name of the page to set background (body.pagelayout-report { background: ... report.jpg .... })

 report - how to find what is the name of the page. 


Regards

Rahul

Marek Hanacek
Re: Add background image
von Marek Hanacek – Friday, 28 September 2018, 5:22 AM
Gruppe Partners

Just inspect (F12 in normal browsers) the html code of current page and focus on body tag.

There is always specific/unique body ID and mutliple classes (mosly unique) which will help you identify current page content in browser.
Look at the screenshot, it should be self explaining.


Its me Rahul
Re: Add background image
von Rahul Kumar – Monday, 1 October 2018, 12:35 AM
 
Thank you Marek .


I really appreciate your help.


Regards

kumar