Alternative PAGE_CONTAINER

Valhalla

Well-known member
What is the best way to use an alternative PAGE_CONTAINER template under certain circumstances?

What I might do is modify the renderContainer method from ViewRenderer/HtmlPublic.php.

At the moment I am altering the template individually for each action that requires it, by altering the responseView (below), but I'm sure there is a better way.

Code:
return $this->responseView('XenForo_ViewPublic_Error_RegistrationRequired', 'error_with_login', $viewParams, array('containerTemplate' =>
            'ALT_PAGE_CONTAINER'));
 
This worked:

PHP:
public static function frontControllerPreView(XenForo_FrontController $fc, XenForo_ControllerResponse_Abstract &$controllerResponse, XenForo_ViewRenderer_Abstract &$viewRenderer, array &$containerParams)
{
     $containerParams += array(
          'containerTemplate' => 'ALT_PAGE_CONTAINER'
     );
}
 
Top Bottom