在这个例子中,我们有两个领域:
1)设置子域名指向到不同的目录上:
http://www.example.com
http://subdomain.example.com
要为子域使用不同的模板,我们可以通过以下步骤来完成此服务器:
Domain: /home/wherever/public_html
Sub-domain: /home/wherever/public_html_subdomain
2)将您的index.php文件到您的新的子域目录,并更新CRAFT_TEMPLATES_PATH变量指向的位置你想要有你的模板。在这个例子中,两个模板文件夹位于Web根目录之上。
// index.php for domain
define('CRAFT_TEMPLATES_PATH', realpath(dirname(__FILE__) . "/../templates").'/');
// index.php for subdomain
define('CRAFT_TEMPLATES_PATH', realpath(dirname(__FILE__) . "/../templates_subdomain").'/');
您的模板文件夹现在的样子:
/home/wherever/public_html
/home/wherever/public_html_subdomain
/home/wherever/templates
/home/wherever/templates_subdomain
我不明白,在不同的子域和不同的主题?是同一主题中每个子域的不同模板部件?并正在使用? –