Moodle 2.0 & Creating a custom block plugin

Moodle 2.0 & Creating a custom block plugin

Andre Clements - ން
Number of replies: 7

I'm following the instructions at http://docs.moodle.org/en/Development:Blocks#Ready.2C_Set.2C_Go.21 on a reasonably fresh beta of 2.0 at the point where the basic file has been created and I expect to see something about the block in Admin Notifications nothing seems to happen.

Does this work differently in 2.0?

I'm a relative newb to Moodle, the instance is running on XAMPP

Tx

Average of ratings: -
In reply to Andre Clements

Re: Moodle 2.0 & Creating a custom block plugin

Frank Ralf - ން
Hi Andre,

Documentation on Moodle 2.0 development is still in its infancy ވިންކް (އެއް ލޯ މެރި)
See Development:Migrating contrib code to 2.0 and User:Frank Ralf/Experience of converting a module to Moodle 2 for some pointers.

hth
Frank
In reply to Frank Ralf

Re: Moodle 2.0 & Creating a custom block plugin

Andre Clements - ން

Thanks Frank

I though'd id' just add a note about the version.php file on that documentation page but it keeps claiming I'm not logged in އެކުވެފައި

In reply to Andre Clements

Re: Moodle 2.0 & Creating a custom block plugin

Frank Ralf - ން
Hi Andre,

In fact, Moodle Docs is driven by MediaWiki so your Moodle log-in is of no use. You will have to register separately for Moodle Docs to be able to edit pages. Just give it a try. Thanks for contributing!
In reply to Frank Ralf

Re: Moodle 2.0 & Creating a custom block plugin

Nitish Tyagi - ން

Hi,

I am using custom made block in Moodle 2.0 .I am trying to get few images appear in the block but they don't appear and it shows a broken image on the page.

Everything worked just fine in Moodle1.9.Any changes that i need to make in 2.0 for images to appear in the block.

Thank you.

In reply to Nitish Tyagi

Re: Moodle 2.0 & Creating a custom block plugin

Jenny Gray - ން

Have the images moved? Are you getting any errors to go with the broken image?  What happens if you call the image url itself rather than as the src of an <img> tag?

The old way of accessing the pix folder ($CFG->pixpath) is no longer supported.  Instead you might need to use the new $OUTPUT global, which can do something like $OUTPUT->pix_url('i/edit'); to get the url for the edit icon.  The $OUTPUT functions are well documented in the code, so I won't go through it all here, but basically you give the name of the image in the first parameter, and any plug-in location as a second parameter  - so you might need to add your block in there.