Skip to content

Commit

Permalink
NEXT-21959 - allowing all .twig files (for also including xml files)
Browse files Browse the repository at this point in the history
fixes #2513
  • Loading branch information
christopherPix authored and NiklasLimberg committed Jun 29, 2022
1 parent f13d6e7 commit c1312c5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions changelog/_unreleased/2022-06-13-allow-all-twig-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Allowing all .twig files
issue: NEXT-21959
author_email: christopher@pixupmedia.com
author_github: christopherPix
---
# Core
* Changed the constant `ALLOWED_FILE_EXTENSIONS` in `src/Core/Framework/App/Template/TemplateLoader.php` from `*.html.twig` to `*.twig`
2 changes: 1 addition & 1 deletion src/Core/Framework/App/Template/TemplateLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TemplateLoader extends AbstractTemplateLoader
'documents',
];

private const ALLOWED_FILE_EXTENSIONS = '*.html.twig';
private const ALLOWED_FILE_EXTENSIONS = '*.twig';

/**
* {@inheritdoc}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% sw_extends '@Storefront/storefront/page/sitemap/sitemap.xml.twig' %}

{% block sitemap %}
{{ parent() }}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testGetTemplatePathsForApp(): void
sort($templates);

static::assertEquals(
['storefront/layout/header/header.html.twig', 'storefront/layout/header/logo.html.twig'],
['storefront/layout/header/header.html.twig', 'storefront/layout/header/logo.html.twig', 'storefront/page/sitemap/sitemap.xml.twig'],
$templates
);
}
Expand Down

0 comments on commit c1312c5

Please sign in to comment.