Themes

Moodle 2.0 anomaly theme

 
Picture of Gunilla Brattberg
Svar: Re: Moodle 2.0 anomaly theme
 

I want to replace h1 with logo.jpg in theme anomaly (Moodle 2.2.7). Ihave tried to change

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

to

<h1 class="headermain"><?php echo $OUTPUT->pix_url('logo.jpg', 'theme'?></h1>

in general.php.

But it didn´t work.

Hoe do I do it correct?

 

 
Average of ratings: -
It's only an avatar...
Re: Svar: Re: Moodle 2.0 anomaly theme
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

Hi,

Drop the .jpg as that is not required in the PHP to add an image.

<h1 class="headermain"><?php echo $OUTPUT->pix_url('logo', 'theme')?></h1>

You could also add the logo via CSS which is the prefered way.

h1.headermain {
 background: color image repeat position;
 height: value;
 width: value;
 margin: value;
 padding: value:
}
So something like this will work too...

h1.headermain {
background: #fff url([[pix:theme|logo]]) no-repeat left top;
height: 100px;
width: 350px;
margin-left: 25px;
padding-top: 30px;
}

Hope this helps?

Mary

 
Average of ratings: -
Picture of Richard Oelmann
Re: Svar: Re: Moodle 2.0 anomaly theme
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

In addition to Mary's advice - check the line you have given. It may be a typo in what you have added in the forum, but if you have copied and pasted it from your code, then you have a missing bracket

<h1 class="headermain"><?php echo $OUTPUT->pix_url('logo.jpg', 'theme')?></h1>

Richard

 
Average of ratings: -
It's only an avatar...
Re: Svar: Re: Moodle 2.0 anomaly theme
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

Thanks Richard I missed that closing bracket. I also missed them off the url CSS. sad

 
Average of ratings: -
Picture of Gunilla Brattberg
Svar: Re: Svar: Re: Moodle 2.0 anomaly theme
 

Thank you!

In general.css I tested to write

h1.headermain {
    background: #fff url([[pix:theme|logo]]) no-repeat left top; 
   
float: left;
    height: 100px;
    width: 350px;
    margin-left: 25px;
    padding-top: 30px;
}

It didn´t import the logo-image.

and in general.php I tested

<h1 class="headermain"><?php echo $OUTPUT->pix_url('logo', 'theme')?></h1>

which resulted in the following header:

http://www.varkstaden.se/logo/theme/image.php?theme=anomaly&image=logo&rev=281&component=theme

 

 
Average of ratings: -