Access Module (Activity) Icon

Access Module (Activity) Icon

by Johj Brazeson -
Number of replies: 2

Hello, I am trying to develop a plugin, however, I ecountered an issue trying to improve its look.

How can I access default icon (or current theme icon that overrides default one) of some module to display it?

I have tried looking at render pages but could not understand how to do it.

Average of ratings: -
In reply to Johj Brazeson

Re: Access Module (Activity) Icon

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

See https://docs.moodle.org/dev/Using_images_in_a_theme, which explains more about images in Moodle in general, even though it does not answer your exact question.

The answer to your question is really the method $OUTPUT->pix_url('icon', 'mod_forum').

https://github.com/moodle/moodle/blob/master/lib/outputrenderers.php#L251

In reply to Tim Hunt

Re: Access Module (Activity) Icon

by Johj Brazeson -

Thank you.

I have missed that document thinking it will be about theme building without any code, however, it does answer my question.

Will be a lesson for me to read everything.