Cloned More Theme(previous version) and 2.9 Logo Issue

Cloned More Theme(previous version) and 2.9 Logo Issue

by Simon Ward -
Number of replies: 6

When we upgraded to 2.9, themes that I had created (by cloning the "More Theme") didn't play nicely.


The custom CSS (to increase logo height) in my default theme wasn't working, but changing this fixed that:

a.logo {height: 100px;}  -->  div.logo {height: 100px;}


Problem:

I have a second/different theme used in one category. The only difference is the background image.

Nothing is being displayed where the logo should be (not even the text name, which is used if no logo is given?)

No space (or "height") is rendered.

Changing the CSS above creates the correct amount of "space", but the logo I upload within the Theme's settings is not appearing.

I've tried renaming the logo, re-uploading it, and clearing Theme Cache in the Theme selectors.


Any ideas?

Average of ratings: -
In reply to Simon Ward

Re: Cloned More Theme(previous version) and 2.9 Logo Issue

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

Hi,

Unfortunately Moodle HQ decided to change the way the page-header was added and now is all done via a renderer in Clean theme. If your child themes rely on the Clean theme layout files then you need to add the old version from 2.8 to get them to work as they used to do.

https://github.com/lazydaisy/moodle/tree/MOODLE_28_STABLE/theme/bootstrapbase/layout

Hope this helps?

Mary

In reply to Mary Evans

Re: Cloned More Theme(previous version) and 2.9 Logo Issue

by Simon Ward -

Changing the custom CSS (from a.logo to div.logo) fixed the main/default theme.

But for some reason the logo uploaded within the settings page of the second theme (used in only one category) wasn't being used.

I've manually added CSS to the custom CSS options of the theme to display the logo (uploaded in settings) as a background:


div.logo {

 height: 100px;

 background: url(//moodle.tgs.qld.edu.au/pluginfile.php/1/theme_tgs_js/logo/1438211930/logo_js.png) no-repeat 0 0;

}


This works now, but will the URL change?

I worked out the URL by using "inspect element" on my working theme. I changed the name of the theme in the URL, and it worked.

But I don't understand the "number" (1438211930) in the URL - what does that represent, and will it change?

Am I going to find that my logo isn't being display tomorrow...

In reply to Simon Ward

Re: Cloned More Theme(previous version) and 2.9 Logo Issue

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

Hi Simon, 

what you should have done is added a layout directory to your cloned themes, together with the layout files from the older version of Clean theme. This would have saved you changing the CSS.

The actual problem is that More relies on Clean theme layout files, and since Clean them underwent the change, so too did More to some lesser degree.

That said, I am not sure why the background image is not workin, this could also be a related issue, in fact it may even be a regression caused by those latest updates to the page header.

I need to investigate.

To save time is there a chance you could send me a link to your site with basic access so I can see the page which is missing the background?

Thanks

Mary

In reply to Mary Evans

Re: Cloned More Theme(previous version) and 2.9 Logo Issue

by Simon Ward -

Thank you. I think I should have created a "child theme", rather than clone it - but I'm time-poor and still lacking a full understanding of how the Themes work.

The work-around's I have made seem to be working.

Thank you for the offer.

In reply to Simon Ward

Re: Cloned More Theme(previous version) and 2.9 Logo Issue

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

You should drop the ".png" from the url. for the logo to be displayed.


And the "number" is a caching mechanism which represent the time (in seconds since standard epoch of 1/1/1970

Each time you click "purge caches" a new number is generated from current internal server time and with it... 

all the CSSes, JSes, theme's resources, language strings...

In reply to Nadav Kavalerchik

Re: Cloned More Theme(previous version) and 2.9 Logo Issue

by Simon Ward -

"You should drop the ".png" from the url. for the logo to be displayed."

The CSS above is what I have used to make it work - there isn't an issue with including ".png"


"And the "number" is a caching mechanism which represent the time (in seconds since standard epoch of 1/1/1970

Each time you click "purge caches" a new number is generated from current internal server time and with it... 

all the CSSes, JSes, theme's resources, language strings..."

Thank you, that makes sense and confirms that my "fix" won't last forever.

I think I'm just going to drop the logo somewhere on the server and point directly to that...