More theme: different background for courses possible?

More theme: different background for courses possible?

by Nick Varney -
Number of replies: 2

Hi,

I'm tweaking the More theme on a development 2.9.2 site and wondered if it was possible to set a separate background image for the home page to that of every other course on the site? This would allow me to have a background for the main page that is very distinctive, but set a more neutral background image for all the other courses. I appreciate the front page is a course itself so I suspect this isn't possible or easy but worth an ask.

Thanks.

Average of ratings: -
In reply to Nick Varney

Re: More theme: different background for courses possible?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

This can be done, but it would mean you need to first make a child theme that inherits from the More theme but add a new setting to add a frontpage background image, which is quite laborious and mind boggling!

Alternatively a simpler method would be to add an alternative frontpage image directly to the More theme pix directory: For example:

moodle/theme/more/pix/fp-bgimage.jpg

and add this to your More settings Custom CSS area on that settings page...

#page-site-index {
    background-image: url([[pix:theme|fp-bgimage]]);
    background-repeat: no-repeat;
    background-position: left top;
}

Which should work.

Hope this helps?

Mary

Average of ratings: Useful (3)
In reply to Mary Evans

Re: More theme: different background for courses possible?

by Nick Varney -

Brilliant, thanks Mary. Worked like a charm.