Costom Block

Costom Block

by Erwin Kroontje -
Number of replies: 4

I have made a custom block, but when i click on the button for the grade it gives an error. Is it possible tot give this link the course id automatic??

The pic i included gives a slight idea what i mean. 

Thank in advance smile

Attachment pagewithblock.PNG
Average of ratings: -
In reply to Erwin Kroontje

Re: Costom Block

by Erwin Kroontje -

The picture above is of the home page. When you open "Mijn cursussen" (Moodle/my) then the option of the "Cijfer" becomes available. Is it possible to change thsi links in a picture. Something like the pic i send with this post.

Attachment Pic1.png
In reply to Erwin Kroontje

Re: Costom Block

by Erwin Kroontje -

No one with a solution?? Too bad! 

In reply to Erwin Kroontje

Re: Costom Block

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

If you want to add a link to an image then you do the normal thing by adding HTML <a href=" # " title="link"><img src="image.png" alt="image" /></a>

In PHP this is done using something like this...

<a href="<?php echo $CFG->wwwroot; ?>/my"><img src="<?php echo $OUTPUT->pix_url('courses', 'block')?>" titl="<?php echo get_string('myhome');?>" /></a>
<a href="<?php echo $CFG->wwwroot; ?>/user/profile.php" title="<?php echo get_string('myprofile');?>"><img src="<?php echo $OUTPUT->pix_url('profile', 'block')?>" alt="<?php echo get_string('myprofile');?>"/></a>
<a href="<?php echo $CFG->wwwroot; ?>/user/filesedit.php" titl="<?php echo get_string('myfiles');?>"><img src="<?php echo $OUTPUT->pix_url('myfiles', 'block') ?>" /></a>

Of course you will know where these would have to be if you made the block...yes?

HTH

Mary
                 

In reply to Mary Evans

Re: Costom Block

by Erwin Kroontje -

I made it in a html-block. But "Mijn scores" must link to ../grade/report/user/index.php?id=2. And the number 2 changes to the course you are viewing at the monent when you click on it. Normally the grade function shows up in the settings block, but i can't find in the block_settings.php where i can change this to this picture. 

Thanks smile