Craft 3 Plugins - Setting Template Path To Site Templates In Craft 2, if you have a plugin that needs to load a view from the site templates directory, you could just go:

# Set the template context to site templates.
$path = craft()-&gt;path-&gt;getSiteTemplatesPath();
craft()-&gt;path-&gt;setTemplatesPath($path);

# Now we can load sweet templates from the sites templates dir, not the plugin one.
craft()-&gt;templates-&gt;render("/path/to/particular/site/template");


I'm struggling with doing this in a Craft 3 plugin. I thought I was on the right track with the below, but the context isn't updating.

# Set the template context to site templates.
$path = Craft::$app-&gt;getPath()-&gt;getSiteTemplatesPath();
Craft::$app-&gt;getView()-&gt;setTemplatesPath($path);

# Or this seems like it might do the same? 
# Craft::$app-&gt;getView()-&gt;setTemplateMode(View::TEMPLATE_MODE_SITE);

# Render the view!
Craft::$app-&gt;getView()-&gt;render("/path/to/particular/site/template")


This results in explosions. It shows the error:


  Unable to resolve view file for view
  '/path/to/particular/site/template': no active view context.


Setting the template context is the bit that's not working. It's still looking at the plugin template directory.
Ok I've made sense of this - if you set the view template mode/context to site, then use the view renderTemplate() method (not render) it works.

So this is how you achieve the same thing in Craft 3. 

# Set the template context to the site mode.
Craft::$app-&gt;getView()-&gt;setTemplateMode(View::TEMPLATE_MODE_SITE);

# Now using the renderTemplate() method, it will work.
$html = Craft::$app-&gt;getView()-&gt;renderTemplate("/path/to/particular/site/template");


Edit: Lenka commented pointing out there is actually some official documentation on this.