markc Posted March 13, 2014 Share Posted March 13, 2014 Hi, I am developing a theme and would like to disable the output from header.tpl and footer.tpl when I request any pages via AJAX. The tpl pages do not seem to "execute" any PHP so how would I provide live code in the template system to disable certain parts of a page under certain circumstances, like if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) exit(0); at the top of header.tpl? 0 Quote Link to comment Share on other sites More sharing options...
KousakaKirino Posted March 22, 2014 Share Posted March 22, 2014 Hey, In the Smarty templating language you can actually can run PHP code. For your case: {php} if (!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) : {/php} //normal content {php} endif; {/php} For more information on the {php} http://www.smarty.net/docs/en/language.function.php.tpl 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.