Forums | Mahara Community

Developers /
Changing the Logo


anonymous profile picture
Account deleted
Posts: 197

04 February 2013, 17:01

Hi Nayomie,

You can also make a very very basic theme with just the theme configuration file and the logo file. That way when it comes time to make the full theme, you just take the basic one and make it better.

It also means that when it comes to upgrade the site, your changed theme will not get overwritten by the default files.

  • Under the theme directory make a new directory for your theme, make sure it has a distinctive name.
  • Inside that, make a file called themeconfig.php with the contents:
<?php
$theme = new StdClass;
$theme->displayname = 'LogoTheme';
$theme->parent      = 'default';
  • You will want the "displayname" above to be recognisable. I've said "LogoTheme" to demonstrate. If you want to use a different theme as the base, you can use the name of the other theme instead of 'default', eg, 'aqua'.
  • Also in the new theme's directory, put a directory called "static"
  • Inside the directory called static, put a directory called "images"
  • Finally, inside the directory called images, you can put your logo, with the filename of site-logo.png.

Hope this helps!

Thanks,
Melissa.

anonymous profile picture
Account deleted
Posts: 34

19 February 2013, 11:56

Thanks for the advice  Melissa :)

We will give it a go and see how it works for us.

Regards

Nayomie

Kristina Hoeppner's profile picture
Posts: 4863

03 March 2013, 11:51

Hello Nayomie,

You do not see your logo when you are logged out because the logo is only visible for users of that institution in which you uploaded the logo. There is no logo upload for the entire site, i.e. "No institution" yet. Thus, you'd have to go via the code / new theme.

Cheers

Kristina

anonymous profile picture
Account deleted
Posts: 34

05 March 2013, 9:58

Thanks Kristina and Melissa

Our ICT team have now duplicated the Aqua theme to use as a base for a new site-wide theme using the information Melissa has provided and included our logo which is working well.

Thanks again for the advice :)

anonymous profile picture
Account deleted
Posts: 3

17 September 2014, 7:58

How can I change the logo in Mahara version 1.9.2, please I need help with how to change it. The main Mahara logo both top and bottom because in the theme/static/image there is no  site-logo. show up there. And please including how to add it there also, i was able to change the institution logos.  

 

Thanks

Robert Lyon's profile picture
Posts: 773

17 September 2014, 8:54

Hi Joseph,

The top logo can be found at: theme/raw/static/images/site-logo.png
the footer logo can be found at: theme/raw/static/images/powered_by_mahara.png

To change the site logo you can either:

1) If you are using a theme other than 'Raw' theme then you can make your own logo image files and add them to the theme you are using, eg if you are using 'Default' theme then add the files to theme/default/static/images/site-logo.png and theme/default/static/images/powered_by_mahara.png and they will be displayed instead of the ones existing in the 'Raw' theme.

2) If you are using the 'Raw' theme as your theme you can replace the files but note that they will be overwritten if you upgrade the site so keep a backup of them somewhere safe.

Cheers

Robert

 

anonymous profile picture
Account deleted
Posts: 3

18 September 2014, 8:37

Robert Lyon 

I'm able to upload my own logo but nothing happens, I am looking for the code that contain this code  ( theme/primaryschool/static/images/site-logo.png) so that I can replace mine there which will make it easy for me, there i can change both the mahara power by and top logo. please, which code contain this link ( theme/primaryschool/static/images/site-logo.png) hope you understand what am trying to ask you. 

Thanks

Best Regard 

Joseph 

Aaron Wells's profile picture
Posts: 896

18 September 2014, 13:59

Hi Joseph,

The site logo URL is from the function "header_logo()" in the "Theme" class in lib/web.php. In mahara 1.9.2 this function is on line 949, but it'll probably be a different line number in other releases. Just search the file for "function header_logo(" and you should find it.

The "Powered by Mahara" logo is specified in some of the footer files of the "raw" theme. Specifically "footer.tpl", "microfooter.tpl", and "admin/upgradefooter.tpl"

These both use the $THEME->get_url() method, which uses Mahara's theme inheritance scheme to find the logo file to use, depending on the current theme that's being displayed. Most of the Mahara core files supply their own copy of site-logo.png, so there's not much inheritance involved in that one. Primary School is the only theme that provides its own copy of the "Powered by Mahara" logo; all the others inherit theirs from the Raw theme.

Cheers,

Aaron

anonymous profile picture
Account deleted
Posts: 3

18 September 2014, 15:59

Thanks for your help, I was able to change the footer logo but still I cannot find the code for the header -logo or top logo that is in the left corner. Please can anyone help me with this thanks. I have spend almost three hours going through all the codes in the theme but it can't be find. 

Kristina Hoeppner's profile picture
Posts: 4863

02 November 2014, 18:54

Hello Joseph,

If you want to replace the site logo in the Primary School theme, all you need to do is replace that logo with your own. You already provided the path in your post: theme/primaryschool/static/images/site-logo.png. It will be best if your logo matches the dimensions of the primary school site logo so that it works correctly in the theme.

Cheers

Kristina

 

20 results