Custom background in a Lesson

Custom background in a Lesson

deur Kate Rhodes -
Getal antwoorde: 11
Hi there,
Just wondering if there is a way to put a custom background in a lesson? I've looked at the Lesson formatting, and know you can use a 'slide show' format and pick a background colour, but I thought it would be really cool if you could put a background image there instead.
I've built my lesson in moodle (it's not a powerpoint) but it would be nice to spruce up the background that's all.

When someone has a moment, it would be great to hear your thoughts!
Cheers!
Kate
Gemiddeld van beoordelings: -
In antwoord op Kate Rhodes

Re: Custom background in a Lesson

deur Joseph Rézeau -
Prentjie van Core developers Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers Prentjie van Testers Prentjie van Translators

Hi Kate,

It is possible to provide an image background for all of your Lessons' slideshow pages, with a small hack to your visual theme.

Find an image of the same size that you will be using for the slideshow (approx. 600 x 400 px) and upload it to the root of your current moodle visual theme's folder. E.g. slideshow_image.jpg. Please note that if the image is smaller than its container "slideshow box", it will be tiled to fill it.

Edit one of your current theme's CSS files (e.g. the layout.css file, but any will do). At the end, add this line:

.slideshow {background-image:url(slideshow_image.jpg)}

Of course it would be nicer if one could select a different image for different lessons, but the Lesson interface currently does not offer that feature.

Hope that helps,

Joseph

Attached example, using one of my flower macro photos as background.

Aanhangsel image01.jpg
Gemiddeld van beoordelings: -
In antwoord op Joseph Rézeau

Re: Custom background in a Lesson

deur Kate Rhodes -
Great! Thank you for your help. I'm going to go give it a whirl right now!
Thanks again.

Gemiddeld van beoordelings: -
In antwoord op Joseph Rézeau

Re: Custom background in a Lesson

deur Kate Rhodes -
Me again,
I am using the stealth theme, so I created a graphic and put it in the images folder for the theme.

Then I added the line you gave me to the bottom of the 'styles.css' file. Here's what I have:
.slideshow {background-image:url(LessonBKG.jpg)}

But now, if I go to the lesson and select 'Slideshow' "YES", it wants me to enter a background colour.
What do I put there? I must be missing something huh?

Looking forward to trying it out!
Kate
Gemiddeld van beoordelings: -
In antwoord op Kate Rhodes

Re: Custom background in a Lesson

deur Joseph Rézeau -
Prentjie van Core developers Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers Prentjie van Testers Prentjie van Translators
Just enter any value for the background color, it will be hidden by the background image anyway.
Value for white = #FFF
Joseph
Gemiddeld van beoordelings: -
In antwoord op Joseph Rézeau

Re: Custom background in a Lesson

deur Stephen Raisz -

I tried this with Moodle 2.1 but no effect. Any suggestions?

Gemiddeld van beoordelings: -
In antwoord op Stephen Raisz

Re: Custom background in a Lesson

deur Joseph Rézeau -
Prentjie van Core developers Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers Prentjie van Testers Prentjie van Translators

The way that themes work in Moodle 2 is totally different from 1.9 and previous versions.

Joseph

Gemiddeld van beoordelings: -
In antwoord op Stephen Raisz

Re: Custom background in a Lesson

deur Miriam Laidlaw -
Prentjie van Plugin developers

For a theme hack for Moodle 2, in the CSS of your theme try

.path-mod-lesson .region-content {

background-image: url([[pix:theme|imagename]]);

}

Making sure to replace imagename with the name of the image that you have saved in the theme's pix folder. This must be put in the css without the file extension.

Example - for an image called lessonbackground.jpg

Correct:

.path-mod-lesson .region-content {

background-image: url([[pix:theme|lessonbackground]]);

}

Incorrect:

.path-mod-lesson .region-content {

background-image: url([[pix:theme|lessonbackground.jpg]]);

}

Gemiddeld van beoordelings: -
In antwoord op Joseph Rézeau

Re: Custom background in a Lesson

deur James Crippin -
I tried what you suggested but never did get the new tool bar to show up. I am usuing Moodle 1.9.1 Is the above for that versions. Thanks
Gemiddeld van beoordelings: -
In antwoord op James Crippin

Re: Custom background in a Lesson

deur Joseph Rézeau -
Prentjie van Core developers Prentjie van Particularly helpful Moodlers Prentjie van Plugin developers Prentjie van Testers Prentjie van Translators
Are you sure you mean Moodle 1.9.1? That is a very old version and is no longer maintained.
Gemiddeld van beoordelings: -
In antwoord op Joseph Rézeau

Re: Custom background in a Lesson

deur James Crippin -

Sorry, left the 0 off...lol

Moodle 1.9.10 is what I have thru my ISP

Gemiddeld van beoordelings: -
In antwoord op James Crippin

Re: Custom background in a Lesson

deur Ana Martins -

Hi there,

I have Moodle 2.6+ (Build: 20131205) and is also not working.

Almost 99% sure is something I'm doing wrong.

But I just don't know what...

The picture is at the Theme's Pix folder and I've added this to the styles.css at mod/lesson


.path-mod-lesson .region-content {background-image: url([[pix:theme|lessonbackground]]);

Question 1

Does it have to be .jpeg / .jpg?

I'm using .png because it has a transparent background, is sword of like a watermark. That might be one of the reasons.


Question 2

I can't get the progress bar color to change from green to blue, it simply won't change.

What am I doing wrong?

.path-mod-lesson .progress_bar_completed {background-color:green; text-align:right; vertical-align:middle; color:#FFF;}


tried:

.path-mod-lesson .progress_bar_completed {background-color:blue; text-align:right; vertical-align:middle; color:#FFF;}


Thank you for your help in advance


Gemiddeld van beoordelings: -