Created
July 17, 2016 08:53
-
-
Save artygrand/656d49941b3a0fd9d1da1526ff6df2ae to your computer and use it in GitHub Desktop.
SyDES plugin: select theme for subsite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$app->on('after.module', 'pages/view/*', function() use($app){ | |
$parts = explode('/', $app->response->data['fullpath']); | |
$themes = str_replace(DIR_TEMPLATE, '', glob(DIR_TEMPLATE . '*', GLOB_ONLYDIR)); | |
if (in_array($parts[0], $themes)) { | |
$conf = $app->config_site; | |
$conf['template'] = $parts[0]; | |
$app->config_site = $conf; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment