Theme: Clean. Where logo apears on the front page should be the course long name in a course.

Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Number of replies: 18
Picture of Particularly helpful Moodlers Picture of Translators
This is Moodle 2.7 almost a default installation using the Clean theme. I've uploaded a Logo in the theme settings. I want it to appear only on the site front page. Once within a course it should vanish, the course long name should appear there instead.

How does one do that, without too much hacks?
Average of ratings: -
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Copy the layout file used by the 'frontpage' layout as defined in config.php, make 'frontpage' use the copy, change the original to remove the logo and only show the name.  CSS hack with 'display: none' won't work as you need the PHP to put back the course name. 

In reply to Gareth J Barnard

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Gareth

That was quick! A small problem though: I have no clue what you are talking about. I should have mentioned that my web design experience is next to none!

Anyway, I went through my $moodle/config-dist.php and found nothing suspicious, nor in $moodle/theme/clean/layout/.

$moodle/theme/clean/settings.php looks more promising. For example:
// Logo file setting.
$name = 'theme_clean/logo';
$title = get_string('logo','theme_clean');
$description = get_string('logodesc', 'theme_clean');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'logo');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);


Is that the right place? What should happen now?
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Mary Evans -

Hi Visvanath,

No this will only confuse matters.

I have added a zip file that contains a whole new set of layout files. I am assuming you have access to the server where your Moodle site is and that you are the Administrator?

Here is what you need to do:

  1. Extract the zip file to your desktop
  2. change your clean theme layout directory to layout_old
  3. add the new layout directory I sent you to your clean theme.
  4. rename your clean/config.php file to config_old.php
  5. place the config.php I sent you in your clean theme folder.

Having done all that you can go to your Moodle site and Purge all cache. Then you will be able to see what it looks like with a Logo in the frontpage only and just titiles in your other pages.

I hope this helps?

Cheers

Mary

In reply to Mary Evans

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Mary C.

This is all magic to me! Well, at least the command line didn't leave me. No, I won't "touch" a machine if I don't have shell access!

I did what you said. Now ./theme/clean/layout/ is what you sent, and also ./theme/clean/config.php. One thing I noticed is that now there is a layout/frontpage.php but no counterpart in layout_old/?

There must be a major omission somewhere. The site brings "Fatal error: Call to undefined method theme_bootstrapbase_core_renderer::user_menu() in /path/to/theme/clean/layout/frontpage.php on line 64".

There is no great hurry: The site is meant for a single blended class. The next presence class is on Friday.
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Must add that I "purged all caches" - but with "php admin/cli/purge_caches.php". Still the same error.
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Mary Evans -

Sorry...my mistake! I sent you 2.8 instead of 2.7 files!

To save time can you put all the original files back and I will redo the changes in a new 'child' theme.

Sorry for my blunder! sad

Mary Evans

In reply to Mary Evans

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Undoing is as simple as renaming a file and a directory!

In case, if you do not plan to invest on 2.7, I can upgrade my site to 2.8. As I said earlier, this site is used by me for just one class.
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Mary Evans -

Hi Visvanath,

In that case upgrade to 2.8 as Moodle does not support 2.7 any longer, that is why I don't use it. I had forgotten that the User menu was added in 2.8 so forgot to remove those bits of code.

Moodle 2.8 works quite nicely, so you should see a difference in the navbar as that has a Log in and changes to a user (drop-down) menu, it also displays the user name and avatar.

However I am still tempted to send you a child theme, so that you keep the changes otherwise an upgrade would wipe them out.

Cheers

Mary

In reply to Mary Evans

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Mary

Then I'll hold on to 2.7. There'll be plenty of others to test on 2.8, etc. Please upload a 2.7 patch when you have time.
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Mary Evans -

Hi Visvanath,

You should create a Moodle Tracker for this as it really needs altering.

I wish I had done that originally, when I put Clean theme together, it would also make better sense if there was a Frontpage that people could configure in a better way than we have at the moment, like the Logo. There should also be the site name on the front page too, not just the logo.

And yes...have the course pages without the logo.

So please do report it as an Improvement...thanks

Mary

In reply to Mary Evans

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Mary

Done: https://tracker.moodle.org/browse/MDL-50661. Hope it is clear.

@all

Feel free to comment, vote, blog, tweet, ...
smile
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
In the mean time noticed that the issue is not "minor" as I initially thought. The group of users on this site have access to two courses: one for the subject and the other one for general organizational matters. In the computer lab I have noticed that some get lost looking for things in the wrong course! A unique title to each course would definitely help.
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Mary Evans -

Well isn't that up to you to sort out? You have the power to give your two courses unique names.

Please do not get sidetracked thinking that whatever is wrong with your Moodle site is theme related because it isn't.  The only thing themes do is adds some colour and uniqueness to your Moodle site. It is not an Aspirin to cure a Moodle headache.

As for the child theme I promised you, well I did make it and it works well, the only thing is it is a Moodle 2.8 theme, as we no longer support 2.7. Si ti use it you would need to upgrade.

Cheers

Mary

In reply to Mary Evans

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Mary

Sure, I give courses unique names! Possibly I am doing something wrong. Screen-shots of the two course pages are attached.

Sure, I can add the course name again in the "General" topic as in the third screen-shot. But that is not ideal - ideally the logo should make space for the course name.
Attachment general.png
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
second course
Attachment electronics.png
In reply to Visvanath Ratnaweera

Re: Theme: Clean. Where logo apears on the front page should be the course long name in a course.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
second course, (less than ideal) modification
Attachment electronics2.png