-
Bug
-
Resolution: Not a bug
-
Minor
-
None
-
4.5.1
-
None
-
MOODLE_405_STABLE
I'm upgrading a Moodle custom theme based on Boost from an early Moodle4 version. This theme uses an image in the footer that was previously referenced using:
$templatecontext = [
'image1' => $OUTPUT->image_url('image1’, 'theme'),
];
Where image1 is in the root of the pix directory and the filename is image1.png.
In the updated documentation (https://moodledev.io/docs/4.5/apis/plugintypes/theme/images) it looks like the the way to reference this image in the template context has changed to
$templatecontext = [
$image1 => $OUTPUT->pix_url('image1’, 'theme'),
];
But this doesn't work form me, unless I'm missing a step. As far as I know nothing else has changed. To work around this I ended up referencing the image directly in the template without using the context as follows:
<img src="config.wwwroot/theme/my_theme/pix/image1.png" alt="My image">
Can someone confirm if the new template context reference works as documented?