Logo only within a course

Logo only within a course

by Josep M. Fontana -
Number of replies: 4
I'm starting to experiment with themes and I notice something that (at least for me) is a little strange. I'm building a course for a specific project within my site. I want the project's logo to be visible only within the project's course, not within the other courses.

However, the only way I have found for the logo to be visible within a course is to inherit it from the site's theme. That is, only if the site's theme has that particular logo can then one use that same theme within the course and have the logo be visible. If I choose a different theme for the site, the logo is no longer visible with that particular theme (which contains a logo) within a course.

For my testing I've used one of the nice themes from MoodleThemes and I've created a logo which I have named 'header_logo.jpg' and I have replaced the old logo with this one.

Can anybody tell me how one can make a logo visible only within the course?

Josep M.
Average of ratings: -
In reply to Josep M. Fontana

Re: Logo only within a course

by Urs Hunkler -
Picture of Core developers

Hi Josep,

if you create one special theme for your project and set this as your course theme in the course settings nothing should interfere with the site theme. Does my answer make sense or did I understand your question wrong?

Urs

In reply to Urs Hunkler

Re: Logo only within a course

by Josep M. Fontana -
Hi Urs,

Thanks again for your quick response. Your answer makes sense but it is in contradiction with the experience I'm having. I've created a special theme simply by making a copy of a particular theme (from one of the MoodleThemes, 'FormalBally15', in ballisticlearning.biz) with a different name ('FormalBally15-B') and then replacing the logo .jpg file in the original theme with a new one. When I set this "new" theme in the course settings, the logo is not visible within the course. The only way to make it visible is making the site's theme be the same as that course theme.

This happened even before I started to experiment with my own logo. When you set the original theme in question in one of your courses, the logo is not visible. The logo only becomes visible in the site's theme. At first I thought that somehow the graphic file was only connected to a special header for the site's main page. But then I noticed that when that particular theme was set as the site's theme, the logo was also visible within all the courses that had that same theme.

But there is something even more strange. If I set the site's theme as 'FormalBally15' and then I set the theme for a particular course as 'FormalBally15-B', the logo I see within the course is the one in 'FormalBally15' and NOT, as one would expect, the new logo created for 'FormalBally15-B'! And viceversa, if I set the site's theme as 'FormalBally15-B' and then I set the theme for the course as 'FormalBally15', the logo I see is the one for 'FormalBally15-B'.
If I chose any other theme, the logo is not visible within the course.

According to what you are saying, this should not be happening, right? I am pretty confused, to tell you the truth.

Josep M.
In reply to Josep M. Fontana

Re: Logo only within a course

by Urs Hunkler -
Picture of Core developers

Josep, after your description your theme header could use the wrong link to the logo.

Does your header.html contain links like (they link to the site theme):

<?php echo "$CFG->wwwroot/theme/$CFG->theme" ?>

If yes, then please try to link to the current selected theme:

<?php echo $CFG->wwwroot.'/theme/'.current_theme() ?>

I hope your logo will work with this change.
Urs

In reply to Urs Hunkler

Re: Logo only within a course

by Josep M. Fontana -
Problem solved!

Thanks very much Urs. Little by little, I'm understanding a bit better how all of this works.

Josep M.