How to return a new template templaterTemplatePostRender

XenConcept

Well-known member
How to return a new template with the event
templaterTemplatePostRender

Code :

Code:
 /**
     * @param Templater $templater | Templater Object
     * @param $type | Template Type
     * @param $template | Template Name
     * @param $output   | Rendered output
     */
    public static function templaterTemplatePostRender(Templater $templater, $type, $template, &$output)
    {
        if($template === 'error')
        {

            $templateRender = $templater->includeTemplate('rd_four_oh_four_error');

            $output = $templateRender;


            \XF::dump($templateRender);
        }
    }

Error :

Code:
Template errors

    Template :rd_four_oh_four_error: Template :rd_four_oh_four_error is unknown (src/XF/Template/Templater.php:498)
 
Do a search in all of the XF files for the following ->renderTemplate('. There should be a few examples, can you spot anything different about them that you might have missed?
 
Do you not see that most of the templates called like this have a prefix, e.g. ->renderTemplate('public:.

You need to prefix your template name with the template type (admin, email or public).
 
Top Bottom