yggdrasil Posted February 20, 2021 Share Posted February 20, 2021 Isn't impressive that Smarty has no redirect variable? At least I was never able to find one. Using JS to redirect is not ideal. 0 Quote Link to comment Share on other sites More sharing options...
Tapeix Posted February 22, 2021 Share Posted February 22, 2021 Well I have been using the following code for years to redirect and it has been working well. {if $templatefile == 'homepage'} {if $loggedin} <html> <body> <script type="text/javascript"> window.location.replace("https://domaincom/clientarea.php"); </script> </body> </html> {/if} {/if} The code determines the current template, then checks if the user is logged in and then redirects the user to the page. It takes about 2 seconds to process. 0 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted February 28, 2021 Author Share Posted February 28, 2021 On 2/22/2021 at 12:19 PM, Tapeix said: Well I have been using the following code for years to redirect and it has been working well. {if $templatefile == 'homepage'} {if $loggedin} <html> <body> <script type="text/javascript"> window.location.replace("https://domaincom/clientarea.php"); </script> </body> </html> {/if} {/if} The code determines the current template, then checks if the user is logged in and then redirects the user to the page. It takes about 2 seconds to process. That is not smarty, that is JavaScript. You could also use PHP but its bad practice to use it with smarty. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 28, 2021 Share Posted February 28, 2021 1 hour ago, yggdrasil said: You could also use PHP but its bad practice to use it with smarty. you could probably write a Smarty plugin to do this if you had to, but I don't think there's much to be gained from that route than the alternatives. 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.