gunter Posted October 4, 2014 Share Posted October 4, 2014 unfortunately this following code does not work, and I don´t know why... if($config->ajax) { // page was requested from ajax $config->appendTemplateFile = ''; // switching off the _main.php template - but does not work... // then do some ajax post handling here... } I like to use the automatic including of the _main.php, via the config.php...but I want switch it off in my template, when a ajax call is coming...How can I override the setting from the config.php on my page? Is it possible, or do I have to make a separate template for this? Link to comment Share on other sites More sharing options...
adrian Posted October 4, 2014 Share Posted October 4, 2014 I don't think you can change that setting in your template because it is already loaded. I think the best approach is to add the following to the top of the template file that is being appended. if($config->ajax) return; or instead you could use: if($useAppended) return; and then in your template files you could do: if($config->ajax) $useAppended = true; Lots of options really 2 Link to comment Share on other sites More sharing options...
gunter Posted October 5, 2014 Author Share Posted October 5, 2014 Oh, thanks, it works now!!!I didn´t thought about using return Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now