Future major features

Element Library

Tim at Lone Pine Koala Sanctuary
Re: Element Library
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

To give a slighly fuller answer

  • add "share this" social network links to forum posts is not something that a theme should be doing. It is forum functionality. It needs to be coded in the forum module. Or done as a separate block add-on.
  • The theme controls the favicon. If you want multiple theses with the same favicon, you need to make several themes with the same favicon. Just like if you want several themes with the same top bar.
  • Ditto.
Average of ratings: -
Picture of Danny Wahl
Re: Element Library
Core developersPlugin developers
Thanks Tim for the fuller answer, and that was my understanding of the situation as it is smile But your answers seem to point to my case that a plugin should be able to modify output:
  • I don't wanna hack mod_forum, or fork and extend mod_forum2, how about a local plugin that extends a single class with share links...
  • I don't wanna upload a favicon to every theme we let users use- or add code for touch icons! how about a local plugin that modifies get_favicon() or standard_html_head()
  • Ditto.

I understand the way moodle works now- I guess the question is: should it change?

I agree that themes shouldn't be adding this type of functionality- but right now they're the only way to do it w/o changing core code.  I mean I guess I could create a dozen little themes that only contain renderers with a handful of methods that output a single "widget" each where I can then include those themes as a parent/grandparent of any other theme and gain the functionality as needed...

Average of ratings: -
Re: Element Library
Core developersParticularly helpful MoodlersPlugin developers

You can also create a local plugin that contains it's own renderer factory and then get all themes to use that.


class local_mylocal_renderer_factory extends theme_overridden_renderer_factory {
    public function __construct(theme_config $theme) {
        array_unshift($this->prefixes, 'local_mylocal');

Then in your theme config.php:

$THEME->rendererfactory = 'local_mylocal_renderer_factory';

This will give your local plugin the final say on any renderers. With the major proviso that, for any renderer classes you create in your local plugin, any renderers overriding the same classes in your themes will be ignored (unless you subclass your local renderers from the theme renderers).

Average of ratings: -