Moodle 2.0 anomaly theme

Moodle 2.0 anomaly theme

Hayk Zakaryan -
回帖数:22

Hi to all.

I am trying to customize anomaly theme on Moodle 2.0.2

I am having some hard time with inserting images on the front page.

In the general.php file, i am trying to insert a logo, instead of heading.

My picture is in the "pix" folder(where theme keeps all the images.)

Here is the code i wrote.

<h1 class="headermain">

<a href="http://localhost/"  id="new">

<img src=[[pix:theme|logo222]]></a> ></h1>

I could insert images as background, but couldn't insert them just as images.

Please any advice.

回复Hayk Zakaryan

Re: Moodle 2.0 anomaly theme

Mary Evans -

Hi Hayk,

Adding images is easy in Moodle 2. but you need to know the bit of code to add it. You are correct about the pix folder. This is indeed where you images go. But how to add them to the page?

<h1 class="headermain">

<a href="http://localhost/"  id="new">

<?php echo $OUTPUT->pix_url('logo222', 'theme')?>

</a> </h1>

This explains about Images and how to use them in Moodle.

http://docs.moodle.org/en/Development:Themes_2.0_How_to_use_images_within_your_theme

HTH

Mary

回复Mary Evans

Re: Moodle 2.0 anomaly theme

Hayk Zakaryan -

Hi Mary,

Thank you very much for code and for the link.

I was blind, there was example of this php code in my php file.

Hayk.

回复Hayk Zakaryan

Re: Moodle 2.0 anomaly theme

Hayk Zakaryan -

Hi Mary i want to ask you one more question,

On this same theme i changed the background-color for

#page  #page-content  {background-color:#F0FFFF;}

Now i still have a white portion under each block (Navigation, Settings, Calendar) and so on. The white part is like 2px high and with the width of the block.

Is that because pictures are used to create the blocks?

How can i get rid of that?

Thanks,

Hayk.

回复Hayk Zakaryan

Re: Moodle 2.0 anomaly theme

Mary Evans -
.block {
background-color: white;
border-width: 0;
}
This is the culprit!!!
Mary
回复Mary Evans

Re: Moodle 2.0 anomaly theme

Hayk Zakaryan -

Hi Mary,

Thanks

I changed the .block styles as you advised, took off overflow:hidden,

I could get rid of that white border, but i still have a small white triangle on every corner of my blocks.

Will you also help with that?

I posted my screenshot on our other conversation(in this forum).

回复Hayk Zakaryan

Re: Moodle 2.0 anomaly theme

Richard Oelmann -
Core developers的头像 Plugin developers的头像 Testers的头像

Hi Hayk,

Anomaly uses images to produce the rounded corners in IE (it uses css3 in FF etc.). The image used is in the pix folder and you would need to recolour the outside corners to match your background.

HTH

Richard

回复Richard Oelmann

Re: Moodle 2.0 anomaly theme

Mary Evans -

That's true Richard, but the images are .gif which should have transparent corners unless you have changed them Hayk, compressed them and altered them in some way?

I've also noticed a problem with this theme. The left column in the Site news forum doesn't seem to want to accept the moz radius in the css. Also the gray looks odd blocked top and bottom and white between! Looks like an ice-cream wafer, the sort you used to get at Blackpool. LOL

Cheers

Mary

回复Mary Evans

Re: Moodle 2.0 anomaly theme

Richard Oelmann -
Core developers的头像 Plugin developers的头像 Testers的头像

Hi Mary,

That's what I would have expected, but on my download (admittedly not the very latest build) the corners_block.gif definitely has a white background rather than trasnparent (viewing the image itself in FF, GIMP and Image Viewer) while the corners_header.gif has a grey background. The gifs in the tab folder do have transparent backgrounds, so I'm fairly sure it's not an issue with my system - but perhaps something that has been corrected on the latest builds as I haven't updated yet for the last few weeks.

Rich

回复Richard Oelmann

Re: Moodle 2.0 anomaly theme

Mary Evans -

They are!! What a pain!!!

Well here are the two images touched up to match the pale background colour Hayk. I hope they are a good match?

回复Mary Evans

Re: Moodle 2.0 anomaly theme

Hayk Zakaryan -

Hi Mary,

Thanks for your help, but actually the corners are still white.

May be i need to cut them out with photoshop or just color the corners? If yes, will you give some direction, i tried but couldn't.

I mean if i decide to change the color of  #page-content i will have to cahnge the color of those corners too.

Hayk.

回复Hayk Zakaryan

Re: Moodle 2.0 anomaly theme

Richard Oelmann -
Core developers的头像 Plugin developers的头像 Testers的头像

and corners_header.gif (sorry forgot to attach it to the first message!)

Rich

附件 corners_header.gif
回复Richard Oelmann

Re: Moodle 2.0 anomaly theme

Hayk Zakaryan -

Hi Rich,

Thank you very much for the pictures.

This is what i need.

After changing the pictures in the pix folder, i am still getting those white corners. I can't understand why?

I did purge all cashes, refreshed.

Hayk.

回复Hayk Zakaryan

Re: Moodle 2.0 anomaly theme

James Cracknell -

Hi

I run using IIS7.5 and compression.  I've found IIS also caches and you have to restart the service.  That could be an issue which is causing problems.  Also clear our the browser cache.

回复Mary Evans

Re: Moodle 2.0 anomaly theme

mohsen afifi -

Hi Mary

 

i need ur help to edit my moodle anomaly theme . i want to add logos and edit the colors and i dont have any idea about the codes and how i can do that .

if u can help me i will be vert grateful to you . if u can give me the way step by step

Regards

mohsen

回复Mary Evans

Svar: Re: Moodle 2.0 anomaly theme

Gunilla Brattberg -

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?

 

回复Gunilla Brattberg

Re: Svar: Re: Moodle 2.0 anomaly theme

Mary Evans -

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

回复Mary Evans

Re: Svar: Re: Moodle 2.0 anomaly theme

Richard Oelmann -
Core developers的头像 Plugin developers的头像 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

回复Richard Oelmann

Re: Svar: Re: Moodle 2.0 anomaly theme

Mary Evans -

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

回复Mary Evans

Svar: Re: Svar: Re: Moodle 2.0 anomaly theme

Gunilla Brattberg -

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