Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignored templates and TemplateFile class #6

Open
mminglis opened this issue Jul 2, 2019 · 1 comment
Open

Ignored templates and TemplateFile class #6

mminglis opened this issue Jul 2, 2019 · 1 comment

Comments

@mminglis
Copy link

mminglis commented Jul 2, 2019

Hi, I've had an issue with Seo Maestro module which uses the TemplateFile class to render output from a template stored in the module folder. This line:

if (in_array($templateFile->page->template->name, $ignoredTemplates)) {
checks against current page template which doesn't work in this situation. It could be changed to the below, although I am not sure if this is the best way to get the file name:

if (in_array(basename($templateFile->filename,".php"), $ignoredTemplates)) {
  return;
}
@kp52
Copy link

kp52 commented Aug 14, 2019

The check for ignored templates in v 0.6.1 also fails when using Tracy Debugger console on a front-end page. The above solution works for me. So does reverting to the checking method used in an earlier version of TemplateLatteReplace (but keeping the array_map trimming):

`

       $ignoredTemplates = array_map('trim', explode(',', $this->ignoredTemplates));

        foreach ($ignoredTemplates as $t) {
            if (strpos($templateFile->filename, $t) !== false) {
                return;
            }
        }

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants