coreshop / CoreShop

CoreShop - Pimcore enhanced eCommerce
http://www.coreshop.org
Other
277 stars 157 forks source link

Pimcore 4: Custom Template Routing #28

Closed solverat closed 8 years ago

solverat commented 8 years ago

add the possibility to add a custom theme in default website structure.

e.g.

/website/views/coreshop/template/TEMPLATE_NAME
solverat commented 8 years ago

i tried to adjust the config/startup.php. if you're adding the template in your website/views/coreshop/template folder, this will work:


$templateBasePath = '';

if( is_dir(PIMCORE_WEBSITE_PATH . '/views/coreshop/template' ) ) {

    $templateBasePath = PIMCORE_WEBSITE_PATH . "/views/coreshop/template";
    $templateResources =  "/website/views/coreshop/template/". $template . "/static/";

} else {

    $templateBasePath = CORESHOP_PATH . "/views/template";
    $templateResources = "/plugins/CoreShop/views/template/" . $template . "/static/";

}

if (!defined("CORESHOP_TEMPLATE_BASE_PATH"))  define("CORESHOP_TEMPLATE_BASE_PATH", $templateBasePath);
if (!defined("CORESHOP_TEMPLATE_NAME"))  define("CORESHOP_TEMPLATE_NAME", $template);
if (!defined("CORESHOP_TEMPLATE_PATH"))  define("CORESHOP_TEMPLATE_PATH", CORESHOP_TEMPLATE_BASE_PATH . "/" . $template);
if (!defined("CORESHOP_TEMPLATE_RESOURCES"))  define("CORESHOP_TEMPLATE_RESOURCES", $templateResources);