Feature Requests
Share ideas, discuss and vote on requests from other users in community
 

Change template folder ( directory )

Davi Souza shared this idea 2 years ago
Already Possible

This request is a way to change the template folder in API, something like this:

$ca->setTemplate( 'my-new-template-file' , 'my-new-template-folder' );

Sometimes we need to create landing pages, or another way to show the products. And we want a clean template, without to many information at header and footer.

If this implemented we could have a template for each kind of products o advirtesiment , and stop using smarttemplate conditions at header and footer.

Comments (3)

photo
1

This could be done as outlined on the Smarty Docs by using a template file from any directory:

http://www.smarty.net/docsv2/en/template.resources.tpl#templates.from.any.dir

photo
1

Doesn't work :(

From this way, the header and footer still comming from the default template.

photo
photo
1

I got a solution foit from WHMCS SUpporting:

<?php

use WHMCS\Database\Capsule;

use WHMCS\View\Menu\Item as MenuItem;

define("CLIENTAREA", true);

// Set the template you want to use for the custom page BEFORE init.php is called

$GLOBALS['_REQUEST']['systpl'] = 'five';

require("init.php");

...

// WHATEVER YOU ARE DOING IN HERE

...

// Set the session back to the default template:

$GLOBALS['_SESSION']['Template'] = 'six';

$ca->output();