Logo in Binarius Theme

Logo in Binarius Theme

by Steve Towson -
Number of replies: 8

Hello.

Can anyone walk me through the process of putting a logo in the header of the binarius theme?

Thanks.

 

Steve

Average of ratings: -
In reply to Steve Towson

Re: Logo in Binarius Theme

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

Development: Themes 2.0 is a good starting place.

Cheers

Mary

In reply to Mary Evans

Re: Logo in Binarius Theme

by Gordon McLeod -

I've just tweaked this myself to add a logo for Binarius, so for anyone interested the line of code to be added is shown in bold in the following snippet from frontpage.php (you'll also want to add it to general.php, and probably report.php) - I've put my logo.png file into the folder pix/pix_core.

<!-- START OF HEADER -->

<div id="page-header">
<div id="page-header-wrapper" class="wrapper clearfix">
   
<a class="logo" title="Home" href="your_moodle_url"><img src="<?php echo $OUTPUT->pix_url('/pix_core/logo', 'theme');?>" align="left"/></a>

<h1 class="headermain"><?php echo $PAGE->heading ?></h1>

Regards, Gordon.

(Edited by Mary Evans - original submission Tuesday, 8 May 2012, 11:23 AM)

Fixed missing apostrophe in href=" ... "

In reply to Gordon McLeod

Re: Logo in Binarius Theme

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

Hi Gordon,

Thanks for that...however I think you will find the the pix_url will find the image if you write it like this...

<a class="logo" title="Home" href="your_moodle_url"><img src="<?php echo $OUTPUT->pix_url('logo', 'theme');?>" align="left"/></a>

At least that was my understanding of the process.  But technically the logo should actually go into the pix directory, rather than pix_core, but like I said it should work anyway. 

Could you test this for me as I have not used pix_core to add custom logo images.  Thanks smile

Mary

In reply to Mary Evans

Re: Logo in Binarius Theme

by Israel Castro -

Hi Mary, maybe you can help me.

I need to put my company logo on the subject binarius, but I put the code and even I can not do.

 <a class="logo" title="Home" href=your_moodle_url"><img src="<?php echo $OUTPUT->pix_url('Logo 01', 'theme');?>" align="left"/></a>


hopefully I can attend noting that parameters of the code I have to change

thanks in advance

thanks in advance

In reply to Israel Castro

Re: Logo in Binarius Theme

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

Hi Israel,

The code you need is this...

<a class="logo" href="<?php echo $CFG->wwwroot; ?>" title="<?php print_string('home'); ?>"></a>

Add it to theme/binarius/frontpage.php using Notepad or a Text Editor

Also make sure the your LOGO is named in lowercase like this...

logo_01.png or logo_01.jpg or logo_01.gif depending on your file type.

The CSS you need is...

/* LOGO
-------------------------*/
a.logo {
    background: url([[pix:theme|logo_01]]) no-repeat 0 0;
    width: 320px;
    height: 75px;
    display: block;
    margin: 15px 10px 10px;
    float: left;
}

Add this to theme/binarius/style/core.css use the values for width and height of YOUR logo. (The values shown here are for example only).

I hope this helps?

Mary

In reply to Mary Evans

Re: Logo in Binarius Theme

by Simon Ludwig -

Hey Mary!

I tried this, but it doesnt work for me...maybe i have a failure in the path? I'm working on XAMPP so my url is: localhost/moodle22/

frontpage.php:

<!-- START OF HEADER -->
<div id="page-header">
<div id="page-header-wrapper" class="wrapper clearfix">
<a class="logo" href="<?php echo $CFG->localhost/moodle22/; ?>" title="<?php print_string('home'); ?>"></a>
<h1 class="headermain"><?php echo $PAGE->heading ?></h1>

And the logo is in /theme/leatherbound/pix/

core.css:

/* LOGO
-------------------------*/
a.logo {
background: url([[pix:theme|asblogo]]) no-repeat 0 0;
width: 320px;
height: 75px;
display: block;
margin: 15px 10px 10px;
float: left;
}

I know that i shouldnt edit existing themes, but today i need it quick and dirty....so dont blame me smile

Maybe someone can help me!

Simon

 

In reply to Simon Ludwig

Re: Logo in Binarius Theme

by Simon Ludwig -

Ok, found a solution that worked for me. Maybe this could help others too:

http://featofdesign.com/stephen/2011/07/31/moodle-2-1-adding-a-logo-to-your-custom-moodle-theme/

Simon

In reply to Simon Ludwig

Re: Logo in Binarius Theme

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

Excuse me but $CFG->wwwroot is already defined in YOUR moodle/config.php check it out and see for yourself, so there is no need to change it.

Also the method employed in the example you posted is not recommended as the image is downloaded on each page refresh whereas the CSS image is cached.

HTH

Mary