nexushosting Posted December 4, 2011 Share Posted December 4, 2011 Hi Guys, I am desperately needing to use the 'default' system template for ordering and my other template for the actual client area. Is there any way I can achieve this? I am aware that it is possible to use different cart templates but that's not going to work for me in this circumstance. Any assistance would be greatly appreciated! Thanks! 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted December 4, 2011 Share Posted December 4, 2011 Some fancy smarty conditionals should achieve what you're looking to do. It would effectively use one template, but modify the output based on the page you're viewing. 0 Quote Link to comment Share on other sites More sharing options...
nexushosting Posted December 5, 2011 Author Share Posted December 5, 2011 Hi, I tried use php to detect the page (either clientarea or cart) and include different headers based on the response but it will be too difficult considering the complex functions I have already used in the header file. Is there any way to do this, or a better alternative to php? Thanks in advance!!! 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted December 5, 2011 Share Posted December 5, 2011 You don't have to use PHP, just use smarty conditionals. you could check the value of $smarty.server.PHP_SELF to see if you're viewing cart.php (effectively, the order form). If you are, show X code. 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted December 5, 2011 Share Posted December 5, 2011 Or, you can change your Order links to: yourdomain.com/whmcs/cart.php?systpl=default Then change the links on the default template to ?systpl=your-main-template 0 Quote Link to comment Share on other sites More sharing options...
nexushosting Posted December 5, 2011 Author Share Posted December 5, 2011 You don't have to use PHP, just use smarty conditionals. you could check the value of $smarty.server.PHP_SELF to see if you're viewing cart.php (effectively, the order form). If you are, show X code. Hi, Thanks for that, I have tried to use smarty code as below in my header.tpl file but I still can't get it to work. It doesn't output anything. Where nexusnetheader.php is the header for my theme and carttheader.php is the header for the default template. {if $smarty.server.PHP_SELF == "https://domain.com/cart.php"} {include include file='https://domain.com/includes/cartheader.php'} {else include file='https://domain.com/includes/nexusnetheader.php'} {/if} Thanks!!!! 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted December 6, 2011 Share Posted December 6, 2011 Take a look and see what PHP_SELF actually returns.. http://php.net/manual/en/reserved.variables.server.php Alistair's solution is probably better anyways. 0 Quote Link to comment Share on other sites More sharing options...
nexushosting Posted December 6, 2011 Author Share Posted December 6, 2011 Take a look and see what PHP_SELF actually returns.. http://php.net/manual/en/reserved.variables.server.php Alistair's solution is probably better anyways. Ok, Thanks. Alastair's solution would be the easiest, however the issue is that it obviously puts the template type in a cookie, so when the user finishes the order, they use the default template, when I want them to use my system template. Unless i'm missing something here? Or, is there any way to pick up the theme that is being used and change it based on the page? Thanks in advance. 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted December 6, 2011 Share Posted December 6, 2011 Hi, Thanks for that, I have tried to use smarty code as below in my header.tpl file but I still can't get it to work. It doesn't output anything. Where nexusnetheader.php is the header for my theme and carttheader.php is the header for the default template. {if $smarty.server.PHP_SELF == "https://domain.com/cart.php"} {include include file='https://domain.com/includes/cartheader.php'} {else include file='https://domain.com/includes/nexusnetheader.php'} {/if} Thanks!!!! Try: {if $filename eq 'cart'} {include file='name-of-your-template-folder/cartheader.tpl'} {else} {include file='name-of-your-template-folder/nexusnetheader.tpl'} {/if} If you are using the "portal" template, the name-of-your-template-folder would simply be portal, e.g: {include file='portal/cartheader.tpl'} Notice it's a .tpl file, not PHP. Hope it helps. 0 Quote Link to comment Share on other sites More sharing options...
nexushosting Posted December 7, 2011 Author Share Posted December 7, 2011 Try: {if $filename eq 'cart'} {include file='name-of-your-template-folder/cartheader.tpl'} {else} {include file='name-of-your-template-folder/nexusnetheader.tpl'} {/if} If you are using the "portal" template, the name-of-your-template-folder would simply be portal, e.g: {include file='portal/cartheader.tpl'} Notice it's a .tpl file, not PHP. Hope it helps. Hi, Your help is much appreciated. I have tried using this however nothing is shown in the header now, so the source of the login page is just the content of that page, the header is not included at the top. Any other ideas? Thanks, Matthew 0 Quote Link to comment Share on other sites More sharing options...
nexushosting Posted December 7, 2011 Author Share Posted December 7, 2011 Got it working, just needed a little extra code. You guys are awesome! Thanks!!!! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.