I'm using the Template Routes plugin to add custom URLs to my EE site. Out of the box, it's set up to use the default EE templates:

$config['template_routes'] = array(
  'blog/:category' => 'site/blog-category',
  'blog/:year/:pagination' => 'site/blog-yearly-archive',
  'blog/:any' => 'site/blog-single',

but I'm using Stash so my templates are located in /templates/. I was just wondering if it's possible to route the URLs to these templates instead?

I've tried just using '/templates/site/blog-category' instead but no dice :(


2 Answers 2


Are you referring to Stash embed templates, using the stash_file_basepath config variable? If so, no, Template Routes cannot use those templates. Unless...

You set your stash template path to match the EE template path:

$config['tmpl_file_basepath'] = '/path/to/a/folder/';
$config['stash_file_basepath'] = $config['tmpl_file_basepath'].'default_site/site.group/';

Then in Template Routes you could call up those templates:

$config['template_routes'] = array(
  'blog/:any' => 'site/some_template',

Just remove the /site/ bit, so they read templates/blog-category, and you should be good to go :).

  • Apologies, that was a typo :) - it did read templates/blog-category but that was still looking in the default templates folder I think?
    – Joe Czucha
    Oct 15, 2013 at 13:25
  • Oh yeah you wanna look at Rob Sanchez's answer below here. Misunderstood your question.
    – Steven
    Oct 15, 2013 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.