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

Wrong Twig Template Loading Order (App vs. Theme) #898

Open
Dead-Man-Walker opened this issue May 12, 2023 · 0 comments
Open

Wrong Twig Template Loading Order (App vs. Theme) #898

Dead-Man-Walker opened this issue May 12, 2023 · 0 comments

Comments

@Dead-Man-Walker
Copy link

Dead-Man-Walker commented May 12, 2023

  • Themosis Version: 3.1.0
  • WordPress Version: 6.2.0
  • PHP Version: 8.0.0

Description

Given two twig templates with identical names, one stored in app/resource/ and the other in app/htdocs/content/themes//views/, the one inside app takes precedence over the one inside themes.
Repeating this setup with php templates, the one inside themes takes precedence over the one inside app, which is expected behavior.

Steps to reproduce

Create two twig templates test-twig.twig with identical names and place one inside the app template directory and the other one inside the theme's template directory:

  • app/resource/test-twig.twig
  • app/htdocs/content/themes//views/test-twig.twig

Repeat this setup with two php templates test-php.php:

  • app/resource/test-php.php
  • app/htdocs/content/themes//views/test-php.php

Create two according routes for rendering the twig and php templates in app/routes/web.php:

Route::get('test-php', function(){
    return view('test-php');
});

Route::get('test-twig', function(){
    return view('test-twig');
});

Open both web pages localhost/test-twig and localhost/test-php to see that the app's twig template and the theme's php template are rendered.

Expected behavior

The theme's twig template should take precedence over the app one.

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

1 participant