Is it possible to change the background of a specific course or course category? Please provide instruction.
Moodle v3 WMAP
Thank you.
Is it possible to change the background of a specific course or course category? Please provide instruction.
Moodle v3 WMAP
Thank you.
Moving to Themes forum...
If you look at the source code of your course page (using developer tools or firebug for example) you will see that Moodle adds a body class for the course and category.
<body id="page-course-view-topics" class="... ... ... pagelayout-course course-2
context-16 category-1 ... ... ...">
You can use that to target css at specific courses or categories, eg.
body.course-2 {background-color:#ffff00;}
So do I add this line to the Custom CSS field in the theme settings? And change the course number to match the course I want it for?
Thanks... i have done so but no luck changing the colour as a test! My course ID is 930 so i have added this in the Clean theme Custom CSS box under theme settings...
body.course-930 {background-color:##ff99ff;}
body.course-930 { background-color: #ff99ff; }
It only needs one # you added two ##
Woops.... Thanks..
If I am trying to change the course background image... is it as either of these??
body.course-930 {background-image:url([[pix:theme|C:\Apache2\htdocs\moodle\server\moodle\theme\clean\pix\back.jpg]]);}
body.course-930 {background-image: url("back.jpg");}
Thanks.
Hi Theo,
You may want to visit this page of the dev documentation: https://docs.moodle.org/dev/Using_images_in_a_theme
Nicolas
Method 1.
body.course-930 {
background-image: url([[pix:theme|back]]);
background-position: left top;
background-repeat: no-repeat;
}
1) You can only use the above method in a stylesheet so add it to the moodle/theme/clean/style/custom.css
Method 2.
body.course-930 {
background-image: url(http://yoursitename.com/theme/clean/pix/back.jpg);
background-position: left top;
background-repeat: no-repeat;
}
2. You can use this method in the Custom CSS text area of the settings page for the Clean theme. But please make sure you have the correct URL where I added: http://yoursitename.com
I hope this helps?
Mary
You are a LEGEND! THANK YOU
Thank you!
Cheers
Mary