How to call functions of a child renderer in mustache files in a custom theme

How to call functions of a child renderer in mustache files in a custom theme

by Carsten S -
Number of replies: 1

Hi!

I've setup a new theme based on boost. I want to override "render_custom_menu" from "lib/outputrenderes.php" from the core_renderer. The problem is that the mustache file "navbar.mustache" still calls "output.custom_menu" which calls "render_custom_menu" of the base renderer but not the overridden function of my renderer.

I just can not figure out how to call this overridden function from within a mustache file. Ive seen some themes which just compute the result in advance and passing the result to the mustache renderer as a context variable. Is this the only way to do this?

Part of the problem, of course, is that $OUTPUT is an instance of "theme_boost\output\core_renderer" and not "my_custom_theme\classes\output\core_renderer"

Thanks in advance!

Average of ratings: -
In reply to Carsten S

Re: How to call functions of a child renderer in mustache files in a custom theme

by Carsten S -

Okay, i've found the issue.

First of all, I did not override the boost renderer correctly. Fixed that, $OUTPUT is now an instace of theme_custom_core_renderer. All functions are now callable from the mustache templates, if $OUTPUT gets passed with it.

Greets