I have a Craft 3 plugin that renders a portion of an entry after save in order to index the resulting information. The plugin needs full access to the Twig extensions on the site to render the template, however several plugins that add such extensions check:
if( Craft::$app->getRequest()->getIsSiteRequest() )
As a result not all Twig extensions load when renderTemplate
is called from the control panel. I set the template mode using:
Craft::$app->getView()->setTemplateMode(View::TEMPLATE_MODE_SITE)
but that only updates the path to the template. Is it possible to render the template as if it were a site request?