I'm working on a plugin called
modelselector and I want to use a template stored in the plugin
templates folder but it should be shown on the front-end of the website.
Currently the following direct URL works for me:
I also set up a site route like so:
'modelselector/(?P<selectionUid>[^\/]+)' => array('action' => 'modelSelector/showSelection')
However when I go to:
modelselector/40c86a9b-53ec-43f4-8e8b-7c77ee0a13f5 I get the error:
Unable to find the template “modelselector/show”..
I did some research and found that I need to set the template mode using:
craft()->templates->setTemplateMode(TemplateMode::CP);. But this doesn't seem to work for me. It still can't find the template when the TemplateMode is on