darrenc Posted September 18, 2015 Share Posted September 18, 2015 Standard website lives at www.foobar.com and by default the template files are served up from /site/templates/ Can processwire be set up to serve requests from dev.foobar.com by pulling template files from another directory? /devsite/templates or /site/devtemplate/ ? Link to comment Share on other sites More sharing options...
Martijn Geerts Posted September 18, 2015 Share Posted September 18, 2015 yes it can 1 Link to comment Share on other sites More sharing options...
Martijn Geerts Posted September 19, 2015 Share Posted September 19, 2015 Place the below in your /site/config.php // Honour goes to Raymond Geerts for the idea ! $config->templates = array( 'dev.foobar.com' => 'devtemplate', // domain => templates folder name ); if (isset($_SERVER['HTTP_HOST']) && isset($config->templates[$_SERVER['HTTP_HOST']], $config->templates)) { foreach ($config->templates as $host => $folder) { if ($_SERVER['HTTP_HOST'] === $host) { // set new paths $config->urls->templates = "/site/" . $folder . "/"; $config->paths->templates = dirname(__DIR__) . $config->urls->templates; break; } } } 7 Link to comment Share on other sites More sharing options...
darrenc Posted September 21, 2015 Author Share Posted September 21, 2015 Ohhhh very interesting. Thank you very much Martijn. Great answer. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now